I get and error when test a stored procedure or query which contains or return a NULL values in it, i have tried the same example which doest return any NULL value and it WORKS perfect , how can i represent NULL in XML file to test it
TEST CODE
public function StarRead()
{
fwrite(STDOUT, METHOD . " Check with valid data \n");
$resultTable = $this->getConnection()->createQueryTable(
'Star', 'CALL get_star(1,NULL,0,2)'
);
$expected = $this->createFlatXMLDataSet(dirname(FILE).'/_files/new.xml');
$expectedTable = $expected->getTable('Star');
//Here we check that the table in the database matches the data in the XML file
$this->assertTablesEqual($expectedTable, $resultTable);
}
I get and error when test a stored procedure or query which contains or return a NULL values in it, i have tried the same example which doest return any NULL value and it WORKS perfect , how can i represent NULL in XML file to test it
TEST CODE
public function StarRead() { fwrite(STDOUT, METHOD . " Check with valid data \n"); $resultTable = $this->getConnection()->createQueryTable( 'Star', 'CALL get_star(1,NULL,0,2)' ); $expected = $this->createFlatXMLDataSet(dirname(FILE).'/_files/new.xml'); $expectedTable = $expected->getTable('Star'); //Here we check that the table in the database matches the data in the XML file $this->assertTablesEqual($expectedTable, $resultTable); }
XML FILE
OUTPUT:
PHPUnit 4.0.12 by Sebastian Bergmann.
DBTest::StarRead Check with valid data F
Time: 1.4 seconds, Memory: 8.50Mb
There was 1 failure:
1) DBTest::StarRead Failed asserting that +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | AutoStar | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | productId | currentPrice | listPrice | createdOn | originalImage | merchantName | title | url | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | 4 | NULL | NULL | 2012-12-12 12:12:12 | link | NULL | Christopher Knight H | link | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
is equal to expected (table diff enabled) +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | AutoStar | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | productId | currentPrice | listPrice | createdOn | originalImage | merchantName | title | url | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+ | 4 | | | 2012-12-12 12:12:12 | link | | Christopher Knight H | link | +----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+----------------------+
.
FAILURES! Tests: 1, Assertions: 1, Failures: 1.