You've already forked phpmyadmin
mirror of
https://github.com/phpmyadmin/phpmyadmin.git
synced 2026-10-23 18:29:15 +03:00
Fix PHPUnit deprecations
Signed-off-by: Liviu-Mihail Concioiu <liviu.concioiu@gmail.com>
This commit is contained in:
@@ -283,7 +283,8 @@ class CentralColumnsTest extends AbstractTestCase
|
||||
*/
|
||||
public function testGetHtmlForEditingPage(): void
|
||||
{
|
||||
$this->dbi->method('fetchResultSimple')
|
||||
$this->dbi->expects(self::once())
|
||||
->method('fetchResultSimple')
|
||||
->with(
|
||||
'SELECT * FROM `phpmyadmin`.`pma_central_columns` '
|
||||
. "WHERE db_name = 'phpmyadmin' AND col_name IN ('col1','col2');",
|
||||
|
||||
@@ -32,11 +32,9 @@ class SearchTest extends AbstractTestCase
|
||||
Current::$database = 'pma';
|
||||
$_POST = [];
|
||||
|
||||
//mock DBI
|
||||
$dbi = $this->createMock(DatabaseInterface::class);
|
||||
$dbi = $this->createStub(DatabaseInterface::class);
|
||||
|
||||
$dbi->method('getColumns')
|
||||
->with('pma', 'table1')
|
||||
->willReturn([
|
||||
new Column('column1', '', null, false, '', null, '', '', ''),
|
||||
new Column('column2', '', null, false, '', null, '', '', ''),
|
||||
|
||||
@@ -36,7 +36,7 @@ final class RecentTableHandlingTest extends AbstractTestCase
|
||||
|
||||
$response = ResponseFactory::create()->createResponse();
|
||||
$handler = $this->createMock(RequestHandlerInterface::class);
|
||||
$handler->method('handle')->with($request)->willReturn($response);
|
||||
$handler->expects(self::once())->method('handle')->with($request)->willReturn($response);
|
||||
|
||||
$reflectionProperty = new ReflectionProperty(RecentFavoriteTables::class, 'instances');
|
||||
$reflectionProperty->setValue(null, []);
|
||||
|
||||
@@ -27,7 +27,7 @@ final class UrlParamsSettingTest extends AbstractTestCase
|
||||
|
||||
$response = self::createStub(ResponseInterface::class);
|
||||
$handler = $this->createMock(RequestHandlerInterface::class);
|
||||
$handler->method('handle')->with($request)->willReturn($response);
|
||||
$handler->expects(self::once())->method('handle')->with($request)->willReturn($response);
|
||||
|
||||
$urlParamsSetting = new UrlParamsSetting(self::createStub(Config::class));
|
||||
self::assertSame($response, $urlParamsSetting->process($request, $handler));
|
||||
|
||||
@@ -643,7 +643,8 @@ final class ExportSqlTest extends AbstractTestCase
|
||||
$dbi->method('quoteString')
|
||||
->willReturnCallback(static fn (string $string): string => "'" . $string . "'");
|
||||
|
||||
$dbi->method('getColumns')
|
||||
$dbi->expects(self::once())
|
||||
->method('getColumns')
|
||||
->with('db', 'view')
|
||||
->willReturn([
|
||||
new Column(
|
||||
@@ -680,7 +681,8 @@ final class ExportSqlTest extends AbstractTestCase
|
||||
$dbi->method('quoteString')
|
||||
->willReturnCallback(static fn (string $string): string => "'" . $string . "'");
|
||||
|
||||
$dbi->method('getColumns')
|
||||
$dbi->expects(self::once())
|
||||
->method('getColumns')
|
||||
->with('db', 'view')
|
||||
->willReturn([
|
||||
new Column(
|
||||
|
||||
Reference in New Issue
Block a user