File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 44
55namespace PhpMyAdmin \Tests ;
66
7+ use mysqli_stmt ;
78use PhpMyAdmin \ConfigStorage \Relation ;
89use PhpMyAdmin \Database \DatabaseList ;
910use PhpMyAdmin \DatabaseInterface ;
11+ use PhpMyAdmin \Dbal \DbiExtension ;
1012use PhpMyAdmin \Dbal \ResultInterface ;
1113use PhpMyAdmin \Query \Utilities ;
1214use PhpMyAdmin \SystemDatabase ;
@@ -718,4 +720,17 @@ public function testGetDatabasesFullDisabledISAndSortIntColumn(): void
718720
719721 $ dummyDbi ->assertAllQueriesConsumed ();
720722 }
723+
724+ public function testPrepare (): void
725+ {
726+ $ query = 'SELECT * FROM `mysql`.`user` WHERE `User` = ? AND `Host` = ?; ' ;
727+ $ stmtStub = $ this ->createStub (mysqli_stmt::class);
728+ $ dummyDbi = $ this ->createMock (DbiExtension::class);
729+ $ dummyDbi ->expects ($ this ->once ())->method ('prepare ' )
730+ ->with ($ this ->identicalTo (2 ), $ this ->equalTo ($ query ))
731+ ->willReturn ($ stmtStub );
732+ $ dbi = $ this ->createDatabaseInterface ($ dummyDbi );
733+ $ stmt = $ dbi ->prepare ($ query , DatabaseInterface::CONNECT_CONTROL );
734+ $ this ->assertSame ($ stmtStub , $ stmt );
735+ }
721736}
You can’t perform that action at this time.
0 commit comments