2727use Doctrine \DBAL \Exception as DBALException ;
2828use Doctrine \DBAL \ParameterType ;
2929use Doctrine \DBAL \Schema \Column ;
30- use Doctrine \DBAL \Types \Type ;
3130use Doctrine \DBAL \Connection ;
31+ use Doctrine \DBAL \Schema \Table ;
32+ use Doctrine \DBAL \Types \Type ;
3233use Doctrine \DBAL \Types \Types ;
3334use PDO ;
3435
@@ -44,15 +45,16 @@ public function setUp() : void
4445 if (self ::$ generated === false ) {
4546 self ::$ generated = true ;
4647 /* @var $sm \Doctrine\DBAL\Schema\AbstractSchemaManager */
47- $ sm = $ this ->_conn ->getSchemaManager ();
48- $ table = new \ Doctrine \ DBAL \ Schema \ Table ("fetch_table " );
48+ $ sm = $ this ->_conn ->createSchemaManager ();
49+ $ table = new Table ("fetch_table " );
4950 $ table ->addColumn ('test_int ' , 'integer ' );
5051 $ table ->addColumn ('test_string ' , 'string ' );
5152 $ table ->addColumn ('test_datetime ' , 'timestamp ' , array ('notnull ' => false ));
5253 $ table ->addColumn ('test_array ' , 'array ' , array ('columnDefinition ' =>'ARRAY(STRING) ' ));
5354 $ platformOptions = array (
5455 'type ' => MapType::STRICT ,
5556 'fields ' => array (
57+ // Those intentionally use DBAL types.
5658 new Column ('id ' , Type::getType ('integer ' ), array ()),
5759 new Column ('name ' , Type::getType ('string ' ), array ()),
5860 new Column ('value ' , Type::getType ('float ' ), array ()),
@@ -78,7 +80,7 @@ public function setUp() : void
7880 public function tearDown () : void
7981 {
8082 if (self ::$ generated === true ) {
81- $ this ->_conn ->getSchemaManager ()->dropTable ('fetch_table ' );
83+ $ this ->_conn ->createSchemaManager ()->dropTable ('fetch_table ' );
8284 self ::$ generated = false ;
8385 }
8486 }
@@ -93,7 +95,7 @@ public function testPrepareWithBindValue()
9395 $ stmt ->bindValue (2 , 'foo ' , PDO ::PARAM_STR );
9496 $ result = $ stmt ->executeQuery ();
9597
96- $ row = $ result ->fetch ( PDO :: FETCH_ASSOC );
98+ $ row = $ result ->fetchAssociative ( );
9799 $ row = array_change_key_case ($ row , \CASE_LOWER );
98100 $ this ->assertEquals (array ('test_int ' => 1 , 'test_string ' => 'foo ' ), $ row );
99101 }
@@ -158,6 +160,7 @@ public function testPrepareWithFetchColumn()
158160
159161 $ stmt ->bindParam (1 , $ paramInt , PDO ::PARAM_INT );
160162 $ stmt ->bindParam (2 , $ paramStr , PDO ::PARAM_STR );
163+ $ stmt ->execute ();
161164 $ column = $ stmt ->getWrappedStatement ()->fetchColumn ();
162165
163166 $ this ->assertEquals (1 , $ column );
@@ -533,8 +536,9 @@ public function testEmptyFetchColumnReturnsFalse()
533536 {
534537 $ this ->_conn ->executeStatement ('DELETE FROM fetch_table ' );
535538 $ this ->refresh ("fetch_table " );
536- $ this ->assertFalse ($ this ->_conn ->prepare ('SELECT test_int FROM fetch_table ' )->getWrappedStatement ()->fetchColumn ());
537- $ this ->assertFalse ($ this ->_conn ->prepare ('SELECT test_int FROM fetch_table ' )->getWrappedStatement ()->fetchColumn ());
539+ $ stmt = $ this ->_conn ->prepare ('SELECT test_int FROM fetch_table ' );
540+ $ stmt ->execute ();
541+ $ this ->assertFalse ($ stmt ->getWrappedStatement ()->fetchColumn ());
538542 }
539543
540544 /**
0 commit comments