Skip to content

Commit

Permalink
Update test for DB_Type_Pgsql_Row
Browse files Browse the repository at this point in the history
Add test settings xml and bootstrap.php (with __autoload)
  • Loading branch information
Maxim Turchin committed Sep 8, 2011
1 parent 36a2489 commit 76110fa
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 3 deletions.
15 changes: 12 additions & 3 deletions lib/DB/Type/Pgsql/Test/RowTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ private function _getCommonTests()
array('b'=>"1", 'a'=>"2"),
'("1","2")',
'some_table',
),
),
array(
new DB_Type_Pgsql_Row(array(
'b' => new DB_Type_String(),
Expand Down Expand Up @@ -111,8 +111,17 @@ protected function _getPairsOutput()
'(,)',
null
),
)
);
'b' => array(
new DB_Type_Pgsql_Row(array(
'b' => new DB_Type_Int(),
'a' => new DB_Type_String(),
)),
array('b' => 'not_int', 'a' => ""),
new DB_Type_Exception_Container(new DB_Type_Pgsql_Row(array()), 'output', 'b', 'DB_Type_Int::output() conversion error: given not_int, expected int32 value'),
null
),
)
);
}

protected function _getPairsInput()
Expand Down
18 changes: 18 additions & 0 deletions utils/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php
/**
* Created by PhpStorm.
* User: nehxby
* Date: 2 жовт 2010
* Time: 0:17:57
* To change this template use File | Settings | File Templates.
*/

function __autoload($classname) {
if (class_exists($classname, false) || interface_exists($classname, false)) {
return;
}
$path = dirname(__DIR__). DIRECTORY_SEPARATOR. 'lib'. DIRECTORY_SEPARATOR
. str_replace('_', DIRECTORY_SEPARATOR, $classname). '.php';
require $path;
}
spl_autoload_register('__autoload');
10 changes: 10 additions & 0 deletions utils/test_settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<phpunit
bootstrap="bootstrap.php"
colors="false"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
stopOnFailure="true">
<!--
-->
</phpunit>

0 comments on commit 76110fa

Please sign in to comment.