Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12373714
BlackholeEngineTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
BlackholeEngineTest.php
View Options
<?php
namespace
Keruald\Database\Tests\Engines
;
use
Keruald\Database\Database
;
use
Keruald\Database\Engines\BlackholeEngine
;
use
PHPUnit\Framework\Attributes\DataProvider
;
use
PHPUnit\Framework\TestCase
;
class
BlackholeEngineTest
extends
TestCase
{
private
BlackholeEngine
$db
;
protected
function
setUp
()
:
void
{
$this
->
db
=
new
BlackholeEngine
();
}
public
function
testGetUnderlyingDriver
()
{
$this
->
assertNull
(
$this
->
db
->
getUnderlyingDriver
());
}
public
function
testQuery
()
{
$this
->
assertTrue
(
$this
->
db
->
query
(
""
));
}
public
function
testNextId
()
{
$this
->
assertEquals
(
0
,
$this
->
db
->
nextId
());
}
public
function
testIsExistingTable
()
{
$this
->
assertTrue
(
$this
->
db
->
isExistingTable
(
"quux"
,
"quuxians"
));
}
public
static
function
provideStringsToEscape
()
:
iterable
{
yield
[
"Lorem ipsum"
];
yield
[
""
];
yield
[
"
\\\\
\n
"
];
}
#[DataProvider('provideStringsToEscape')]
public
function
testEscape
(
$string
)
{
$this
->
assertEquals
(
$string
,
$this
->
db
->
escape
(
$string
));
}
public
function
testLoad
()
{
$config
=
[
'engine'
=>
BlackholeEngine
::
class
,
];
$engine
=
Database
::
load
(
$config
);
$this
->
assertInstanceOf
(
BlackholeEngine
::
class
,
$engine
);
}
public
function
testCountAffectedRows
()
{
$this
->
assertEquals
(
0
,
$this
->
db
->
nextId
());
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Sat, Nov 1, 18:19 (23 h, 31 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3118899
Default Alt Text
BlackholeEngineTest.php (1 KB)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment