Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMaurício Meneghini Fauth <mauricio@fauth.dev>2021-09-13 20:20:21 +0300
committerMaurício Meneghini Fauth <mauricio@fauth.dev>2021-09-13 20:20:21 +0300
commitd441c88aad137b62d391f0a06ec2a89209bff0f1 (patch)
treeb46f09d9020cd54739da0ea48de92a29863aaba9 /test
parentd9c51d60f6c71ec670f448d1bfc764cb7db23bdb (diff)
Fix failing unit tests
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test')
-rw-r--r--test/classes/Server/PrivilegesTest.php5
-rw-r--r--test/classes/TrackerTest.php10
2 files changed, 8 insertions, 7 deletions
diff --git a/test/classes/Server/PrivilegesTest.php b/test/classes/Server/PrivilegesTest.php
index 4d899ade96..296638f1a8 100644
--- a/test/classes/Server/PrivilegesTest.php
+++ b/test/classes/Server/PrivilegesTest.php
@@ -4,6 +4,7 @@ declare(strict_types=1);
namespace PhpMyAdmin\Tests\Server;
+use mysqli_result;
use mysqli_stmt;
use PhpMyAdmin\Config;
use PhpMyAdmin\DatabaseInterface;
@@ -2221,7 +2222,9 @@ class PrivilegesTest extends AbstractTestCase
$mysqliStmtStub = $this->createMock(mysqli_stmt::class);
$mysqliStmtStub->expects($this->exactly(2))->method('bind_param')->willReturn(true);
$mysqliStmtStub->expects($this->exactly(2))->method('execute')->willReturn(true);
- $mysqliStmtStub->expects($this->exactly(2))->method('get_result')->willReturn(true);
+ $mysqliStmtStub->expects($this->exactly(2))
+ ->method('get_result')
+ ->willReturn($this->createStub(mysqli_result::class));
$dbi = $this->createMock(DatabaseInterface::class);
$dbi->expects($this->once())->method('isMariaDB')->willReturn(true);
diff --git a/test/classes/TrackerTest.php b/test/classes/TrackerTest.php
index 2a4a7449cc..8471e87049 100644
--- a/test/classes/TrackerTest.php
+++ b/test/classes/TrackerTest.php
@@ -336,18 +336,16 @@ class TrackerTest extends AbstractTestCase
->disableOriginalConstructor()
->getMock();
- $date = Util::date('Y-m-d H:i:s');
-
$expectedMainQuery = '/*NOTRACK*/' .
"\nINSERT INTO `pmadb`.`tracking` (db_name, table_name, version, date_created, date_updated," .
" schema_snapshot, schema_sql, data_sql, tracking ) values (
'pma_test',
'',
'1',
- '" . $date . "',
- '" . $date . "',
+ '%d-%d-%d %d:%d:%d',
+ '%d-%d-%d %d:%d:%d',
'',
- '# log " . $date . ' pma_test_user' .
+ '# log %d-%d-%d %d:%d:%d pma_test_user" .
"\nSHOW DATABASES',
'" .
"\n',
@@ -355,7 +353,7 @@ class TrackerTest extends AbstractTestCase
$dbi->expects($this->exactly(1))
->method('query')
- ->with($expectedMainQuery, DatabaseInterface::CONNECT_CONTROL, 0, false)
+ ->with($this->matches($expectedMainQuery), DatabaseInterface::CONNECT_CONTROL, 0, false)
->will($this->returnValue('executed'));
$dbi->expects($this->any())->method('escapeString')