Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F53428401
DatabaseExceptionTest.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
DatabaseExceptionTest.php
View Options
<?php
/**
* _, __, _, _ __, _ _, _, _
* / \ |_) (_ | | \ | /_\ |\ |
* \ / |_) , ) | |_/ | | | | \|
* ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
*
* Unit testing — FilesCollection class
*
* @package ObsidianWorkspaces
* @subpackage Tests
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @filesource
*/
require
'../includes/database/DatabaseException.php'
;
/**
* Tests DatabaseException class
*/
class
DatabaseExceptionTest
extends
PHPUnit_Framework_TestCase
{
/**
* @covers DatabaseException::__construct
* @covers DatabaseException::getQuery
*/
public
function
testGetQuery
()
{
$sql
=
'SELECT 1+'
;
$ex
=
new
DatabaseException
(
$sql
,
'Syntax error'
,
1064
);
$this
->
assertEquals
(
$sql
,
$ex
->
getQuery
(),
""
);
$ex
=
new
DatabaseException
();
$this
->
assertNull
(
$ex
->
getQuery
(),
"If the query isn't specified during the constructor call, getQuery shall return null."
);
$ex
=
new
DatabaseException
(
''
);
$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
Sun, Oct 11, 21:05 (5 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4086406
Default Alt Text
DatabaseExceptionTest.php (1 KB)
Attached To
Mode
rOBSIDIAN Obsidian Workspaces
Attached
Detach File
Event Timeline
Log In to Comment