Merge pull request #18411 from kamil-tekiela/short-lambdas
Use short lambdas
This commit is contained in:
commit
1d2ee56f95
@ -38,9 +38,7 @@ class SearchTest extends AbstractTestCase
|
||||
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
$this->object = new Search($dbi, 'pma_test', new Template());
|
||||
|
||||
@ -597,9 +597,7 @@ class ExportSqlTest extends AbstractTestCase
|
||||
['SHOW CREATE EVENT `db`.`f2`', 'Create Event', Connection::TYPE_USER, 'f2event'],
|
||||
]));
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
|
||||
@ -684,9 +682,7 @@ class ExportSqlTest extends AbstractTestCase
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$dbi->expects($this->any())
|
||||
->method('getColumns')
|
||||
@ -726,9 +722,7 @@ class ExportSqlTest extends AbstractTestCase
|
||||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$dbi->expects($this->any())
|
||||
->method('getColumns')
|
||||
@ -1103,9 +1097,7 @@ SQL;
|
||||
[],
|
||||
);
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$tableObj = $this->getMockBuilder(Table::class)
|
||||
->disableOriginalConstructor()
|
||||
|
||||
@ -125,9 +125,7 @@ class ImportLdiTest extends AbstractTestCase
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
$dbi = $this->createMock(DatabaseInterface::class);
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
|
||||
$importHandle = new File($GLOBALS['import_file']);
|
||||
@ -178,9 +176,7 @@ class ImportLdiTest extends AbstractTestCase
|
||||
$GLOBALS['sql_query_disabled'] = false;
|
||||
$dbi = $this->createMock(DatabaseInterface::class);
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
|
||||
$GLOBALS['ldi_local_option'] = true;
|
||||
|
||||
@ -490,9 +490,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
->will($this->returnValue(8003));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$serverPrivileges->dbi = $dbi;
|
||||
|
||||
@ -536,9 +534,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
->will($this->returnValue(80011));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$serverPrivileges->dbi = $dbi;
|
||||
|
||||
@ -839,9 +835,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
->will($this->returnValue($fieldsInfo));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$serverPrivileges->dbi = $dbi;
|
||||
|
||||
@ -907,9 +901,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
->will($this->returnValue($fieldsInfo));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
$dbi->expects($this->any())->method('isGrantUser')
|
||||
->will($this->returnValue(true));
|
||||
|
||||
@ -1691,9 +1683,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
);
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$serverPrivileges->dbi = $dbi;
|
||||
|
||||
@ -1731,9 +1721,7 @@ class PrivilegesTest extends AbstractTestCase
|
||||
->will($this->returnValue('Some error occurred!'));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$serverPrivileges->dbi = $dbi;
|
||||
|
||||
|
||||
@ -47,9 +47,7 @@ class SystemDatabaseTest extends AbstractTestCase
|
||||
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$relationParameters = RelationParameters::fromArray([
|
||||
'table_coords' => 'table_name',
|
||||
|
||||
@ -262,9 +262,7 @@ class TableTest extends AbstractTestCase
|
||||
->will($this->returnArgument(0));
|
||||
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
}
|
||||
|
||||
@ -216,9 +216,7 @@ class TrackerTest extends AbstractTestCase
|
||||
$dbi->expects($this->any())->method('getCompatibilities')
|
||||
->will($this->returnValue([]));
|
||||
$dbi->expects($this->any())->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$GLOBALS['dbi'] = $dbi;
|
||||
$this->assertTrue(Tracker::createVersion('pma_test', 'pma_tbl', '1', '11', true));
|
||||
|
||||
@ -107,9 +107,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase
|
||||
);
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$userPreferences = new UserPreferences($dbi);
|
||||
$result = $userPreferences->load();
|
||||
@ -190,9 +188,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase
|
||||
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$userPreferences = new UserPreferences($dbi);
|
||||
$result = $userPreferences->save([1]);
|
||||
@ -226,9 +222,7 @@ class UserPreferencesTest extends AbstractNetworkTestCase
|
||||
->will($this->returnValue('err1'));
|
||||
$dbi->expects($this->any())
|
||||
->method('quoteString')
|
||||
->will($this->returnCallback(static function (string $string) {
|
||||
return "'" . $string . "'";
|
||||
}));
|
||||
->will($this->returnCallback(static fn (string $string): string => "'" . $string . "'"));
|
||||
|
||||
$userPreferences = new UserPreferences($dbi);
|
||||
$result = $userPreferences->save([1]);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user