Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F12945550
SqlExceptionTest.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
752 B
Referenced Files
None
Subscribers
None
SqlExceptionTest.php
View Options
<?php
namespace
Keruald\Database\Tests\Exceptions
;
use
Keruald\Database\Exceptions\SqlException
;
use
PHPUnit\Framework\TestCase
;
class
SqlExceptionTest
extends
TestCase
{
public
function
testGetQuery
()
{
$sql
=
'SELECT 1+'
;
$ex
=
SqlException
::
fromQuery
(
$sql
,
[
"error"
=>
'Syntax error'
,
"errno"
=>
1064
,
]);
$this
->
assertEquals
(
$sql
,
$ex
->
getQuery
(),
""
);
$ex
=
SqlException
::
fromQuery
(
""
,
[]);
$this
->
assertEquals
(
""
,
$ex
->
getQuery
(),
"If the query isn't specified during the constructor call, getQuery shall not return null but must return an empty string too."
);
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Tue, Nov 18, 17:43 (19 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3130129
Default Alt Text
SqlExceptionTest.php (752 B)
Attached To
Mode
rKERUALD Keruald libraries development repository
Attached
Detach File
Event Timeline
Log In to Comment