Expected Test Failure Report for ext/dba/tests/dba015.phpt ('DBA with persistent connections')
Script
1:
<?php 2: 3: $handler = "flatfile"; 4: require_once(dirname(__FILE__) .'/test.inc'); 5: echo "database handler: $handler\n"; 6: 7: echo "Test 1\n"; 8: $db_file1 = dba_popen($db_filename, 'n', 'flatfile'); 9: dba_insert("key1", "This is a test insert 1", $db_file1); 10: echo dba_fetch("key1", $db_file1), "\n"; 11: 12: 13: echo "Test 2\n"; 14: $db_file2 = dba_popen($db_filename, 'n', 'flatfile'); 15: if ($db_file1 === $db_file2) { 16: echo "resources are the same\n"; 17: } else { 18: echo "resources are different\n"; 19: } 20: 21: 22: echo "Test 3 - fetch both rows from second resource\n"; 23: dba_insert("key2", "This is a test insert 2", $db_file2); 24: echo dba_fetch("key1", $db_file2), "\n"; 25: echo dba_fetch("key2", $db_file2), "\n"; 26: 27: 28: echo "Test 4 - fetch both rows from first resource\n"; 29: echo dba_fetch("key1", $db_file1), "\n"; 30: echo dba_fetch("key2", $db_file1), "\n"; 31: 32: echo "Test 5 - close 2nd resource\n"; 33: dba_close($db_file2); 34: var_dump($db_file1); 35: var_dump($db_file2); 36: 37: echo "Test 6 - query after closing 2nd resource\n"; 38: echo dba_fetch("key1", $db_file1), "\n"; 39: echo dba_fetch("key2", $db_file1), "\n"; 40: 41: ?> 42: ===DONE=== 43:
Expected
database handler: flatfile
Test 1
This is a test insert 1
Test 2
resources are different
Test 3 - fetch both rows from second resource
This is a test insert 1
This is a test insert 2
Test 4 - fetch both rows from first resource
This is a test insert 1
This is a test insert 2
Test 5 - close 2nd resource
resource(%d) of type (dba persistent)
resource(%d) of type (Unknown)
Test 6 - query after closing 2nd resource
This is a test insert 1
This is a test insert 2
===DONE===
Output
database handler: flatfile
Test 1
This is a test insert 1
Test 2
resources are different
Test 3 - fetch both rows from second resource
This is a test insert 1
This is a test insert 2
Test 4 - fetch both rows from first resource
This is a test insert 1
This is a test insert 2
Test 5 - close 2nd resource
resource(8) of type (dba persistent)
resource(9) of type (Unknown)
Test 6 - query after closing 2nd resource
Diff
016- This is a test insert 1
017- This is a test insert 2
018- ===DONE===
Generated at Sun, 19 May 2013 20:27:25 +0000 (2 hours ago)
|