@@ -57,16 +57,14 @@ function wp_get_db_schema() {
5757 public function setUp (): void {
5858 $ this ->sqlite = new PDO ( 'sqlite::memory: ' );
5959 $ this ->engine = new WP_SQLite_Driver (
60- array (
61- 'connection ' => $ this ->sqlite ,
62- 'database ' => 'wp ' ,
63- )
60+ new WP_SQLite_Connection ( array ( 'pdo ' => $ this ->sqlite ) ),
61+ 'wp '
6462 );
6563
6664 $ builder = new WP_SQLite_Information_Schema_Builder (
6765 'wp ' ,
6866 WP_SQLite_Driver::RESERVED_PREFIX ,
69- array ( $ this ->engine , ' execute_sqlite_query ' )
67+ $ this ->engine -> get_connection ( )
7068 );
7169
7270 $ this ->reconstructor = new WP_SQLite_Information_Schema_Reconstructor (
@@ -76,7 +74,7 @@ public function setUp(): void {
7674 }
7775
7876 public function testReconstructTable (): void {
79- $ this ->engine ->get_pdo ()->exec (
77+ $ this ->engine ->get_connection ()->query (
8078 '
8179 CREATE TABLE t (
8280 id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -90,8 +88,8 @@ public function testReconstructTable(): void {
9088 )
9189 '
9290 );
93- $ this ->engine ->get_pdo ()->exec ( 'CREATE INDEX idx_score ON t (score) ' );
94- $ this ->engine ->get_pdo ()->exec ( 'CREATE INDEX idx_role_score ON t (role, priority) ' );
91+ $ this ->engine ->get_connection ()->query ( 'CREATE INDEX idx_score ON t (score) ' );
92+ $ this ->engine ->get_connection ()->query ( 'CREATE INDEX idx_role_score ON t (role, priority) ' );
9593 $ result = $ this ->assertQuery ( 'SELECT * FROM information_schema.tables WHERE table_name = "t" ' );
9694 $ this ->assertEquals ( 0 , count ( $ result ) );
9795
@@ -126,7 +124,7 @@ public function testReconstructTable(): void {
126124
127125 public function testReconstructWpTable (): void {
128126 // Create a WP table with any columns.
129- $ this ->engine ->get_pdo ()->exec ( 'CREATE TABLE wp_posts ( id INTEGER ) ' );
127+ $ this ->engine ->get_connection ()->query ( 'CREATE TABLE wp_posts ( id INTEGER ) ' );
130128
131129 // Reconstruct the information schema.
132130 $ this ->reconstructor ->ensure_correct_information_schema ();
@@ -176,18 +174,18 @@ public function testReconstructWpTable(): void {
176174 }
177175
178176 public function testReconstructTableFromMysqlDataTypesCache (): void {
179- $ pdo = $ this ->engine ->get_pdo ();
177+ $ connection = $ this ->engine ->get_connection ();
180178
181- $ pdo -> exec ( self ::CREATE_DATA_TYPES_CACHE_TABLE_SQL );
182- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'id', 'int unsigned') " );
183- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'name', 'varchar(255)') " );
184- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'description', 'text') " );
185- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'shape', 'geomcollection') " );
186- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_name', 'KEY') " );
187- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_description', 'FULLTEXT') " );
188- $ pdo -> exec ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_shape', 'SPATIAL') " );
179+ $ connection -> query ( self ::CREATE_DATA_TYPES_CACHE_TABLE_SQL );
180+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'id', 'int unsigned') " );
181+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'name', 'varchar(255)') " );
182+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'description', 'text') " );
183+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 'shape', 'geomcollection') " );
184+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_name', 'KEY') " );
185+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_description', 'FULLTEXT') " );
186+ $ connection -> query ( "INSERT INTO _mysql_data_types_cache (`table`, column_or_index, mysql_type) VALUES ('t', 't__idx_shape', 'SPATIAL') " );
189187
190- $ this -> engine -> get_pdo ()-> exec (
188+ $ connection -> query (
191189 '
192190 CREATE TABLE t (
193191 id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -197,9 +195,9 @@ public function testReconstructTableFromMysqlDataTypesCache(): void {
197195 )
198196 '
199197 );
200- $ this -> engine -> get_pdo ()-> exec ( 'CREATE INDEX t__idx_name ON t (name) ' );
201- $ this -> engine -> get_pdo ()-> exec ( 'CREATE INDEX t__idx_description ON t (description) ' );
202- $ this -> engine -> get_pdo ()-> exec ( 'CREATE INDEX t__idx_shape ON t (shape) ' );
198+ $ connection -> query ( 'CREATE INDEX t__idx_name ON t (name) ' );
199+ $ connection -> query ( 'CREATE INDEX t__idx_description ON t (description) ' );
200+ $ connection -> query ( 'CREATE INDEX t__idx_shape ON t (shape) ' );
203201
204202 $ this ->reconstructor ->ensure_correct_information_schema ();
205203 $ result = $ this ->assertQuery ( 'SHOW CREATE TABLE t ' );
@@ -224,7 +222,7 @@ public function testReconstructTableFromMysqlDataTypesCache(): void {
224222 }
225223
226224 public function testDefaultValues (): void {
227- $ this ->engine ->get_pdo ()->exec (
225+ $ this ->engine ->get_connection ()->query (
228226 "
229227 CREATE TABLE t (
230228 col1 text DEFAULT abc,
0 commit comments