55require_once (__DIR__ . '../../src/include.php ' );
66
77final class int64Test extends TestCase {
8+ /**
9+ * @var Connection
10+ */
811 public $ conn ;
912
1013 public function setUp (): void
1114 {
12- $ this ->conn = new Connection ("127.0.0.1 " , 50000 , "monetdb " , "monetdb " , "temp " );
15+ $ this ->conn = new Connection ("127.0.0.1 " , 50000 , "monetdb " , "monetdb " , "myDatabase " );
1316 }
1417
1518 public function testBigIntTable (): void
1619 {
20+ $ this ->conn ->Query ("drop table if exists php_int64_dec18 " );
1721 $ res = $ this ->conn ->Query ("CREATE TABLE php_int64_dec18 (i BIGINT, d0 DECIMAL(18,0), d9 DECIMAL(18,9)); " );
1822
1923 $ this ->assertCount (0 , $ res );
@@ -28,13 +32,10 @@ public function testInsertBigInt(): void
2832
2933 public function testSelectBigInt (): void
3034 {
31- $ res = $ this ->conn ->Query ("SELECT * FROM php_int64_dec18; " );
32- $ res_arr = iterator_to_array ($ res );
35+ $ res = $ this ->conn ->QueryFirst ("SELECT * FROM php_int64_dec18; " );
3336
34- $ this ->assertEquals ($ res_arr [ 1 ] ["i " ], "1234567890987654321 " );
35- $ this ->assertEquals ($ res_arr [ 1 ] ["d0 " ], "123456789987654321 " );
36- $ this ->assertEquals ($ res_arr [ 1 ] ["d9 " ], "123456789.987654321 " );
37+ $ this ->assertEquals ($ res ["i " ], "1234567890987654321 " );
38+ $ this ->assertEquals ($ res ["d0 " ], "123456789987654321 " );
39+ $ this ->assertEquals ($ res ["d9 " ], "123456789.987654321 " );
3740 }
38-
3941}
40- ?>
0 commit comments