diff options
author | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-07-11 20:58:11 +0300 |
---|---|---|
committer | Maurício Meneghini Fauth <mauricio@fauth.dev> | 2022-07-11 20:58:11 +0300 |
commit | 4930c7a119f8a41685b2838dda91848a5f7903c5 (patch) | |
tree | 6ec02f892d784f8861ed41b19af1811ecb16b021 /test | |
parent | 8543e0abe5bc1f9f54361182fd35da8863c5958b (diff) |
Remove the AbstractTestCase::assertAllQueriesConsumed method
Uses the DummyDbi method instead.
Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
Diffstat (limited to 'test')
-rw-r--r-- | test/classes/AbstractTestCase.php | 6 | ||||
-rw-r--r-- | test/classes/Controllers/Import/ImportControllerTest.php | 2 | ||||
-rw-r--r-- | test/classes/Controllers/NavigationControllerTest.php | 4 | ||||
-rw-r--r-- | test/classes/Plugins/Import/ImportCsvTest.php | 4 | ||||
-rw-r--r-- | test/classes/StorageEngineTest.php | 4 | ||||
-rw-r--r-- | test/classes/TwoFactorTest.php | 20 |
6 files changed, 17 insertions, 23 deletions
diff --git a/test/classes/AbstractTestCase.php b/test/classes/AbstractTestCase.php index 3d45b8ce9e..a40f312f41 100644 --- a/test/classes/AbstractTestCase.php +++ b/test/classes/AbstractTestCase.php @@ -102,12 +102,6 @@ abstract class AbstractTestCase extends TestCase Cache::purge(); } - protected function assertAllQueriesConsumed(): void - { - $unUsedQueries = $this->dummyDbi->getUnUsedQueries(); - $this->assertSame([], $unUsedQueries, 'Some queries where not used !'); - } - protected function assertAllSelectsConsumed(): void { $unUsedSelects = $this->dummyDbi->getUnUsedDatabaseSelects(); diff --git a/test/classes/Controllers/Import/ImportControllerTest.php b/test/classes/Controllers/Import/ImportControllerTest.php index 8f9efe2975..16a0ffa675 100644 --- a/test/classes/Controllers/Import/ImportControllerTest.php +++ b/test/classes/Controllers/Import/ImportControllerTest.php @@ -72,6 +72,6 @@ class ImportControllerTest extends AbstractTestCase $this->getResponseHtmlResult() ); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } } diff --git a/test/classes/Controllers/NavigationControllerTest.php b/test/classes/Controllers/NavigationControllerTest.php index 27867582bf..a6783e4961 100644 --- a/test/classes/Controllers/NavigationControllerTest.php +++ b/test/classes/Controllers/NavigationControllerTest.php @@ -161,7 +161,7 @@ class NavigationControllerTest extends AbstractTestCase . '</div>', $responseMessage ); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } public function testIndexWithPosAndValue(): void @@ -427,6 +427,6 @@ class NavigationControllerTest extends AbstractTestCase . '</div>' . "\n", $responseMessage ); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } } diff --git a/test/classes/Plugins/Import/ImportCsvTest.php b/test/classes/Plugins/Import/ImportCsvTest.php index cb385cf2ab..cc59a88448 100644 --- a/test/classes/Plugins/Import/ImportCsvTest.php +++ b/test/classes/Plugins/Import/ImportCsvTest.php @@ -262,7 +262,7 @@ class ImportCsvTest extends AbstractTestCase ); $this->assertEquals(true, $GLOBALS['finished']); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } /** @@ -306,6 +306,6 @@ class ImportCsvTest extends AbstractTestCase ); $this->assertEquals(true, $GLOBALS['finished']); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } } diff --git a/test/classes/StorageEngineTest.php b/test/classes/StorageEngineTest.php index bae1c42fcc..5bb24191ef 100644 --- a/test/classes/StorageEngineTest.php +++ b/test/classes/StorageEngineTest.php @@ -335,7 +335,7 @@ class StorageEngineTest extends AbstractTestCase $this->dummyDbi->addResult('SELECT mroonga_command(\'object_list\');', false); $this->assertFalse(StorageEngine::hasMroongaEngine()); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } public function testGetMroongaLengths(): void @@ -706,6 +706,6 @@ class StorageEngineTest extends AbstractTestCase $this->assertAllSelectsConsumed(); $this->assertSame([4521984, 578126], $lengths); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } } diff --git a/test/classes/TwoFactorTest.php b/test/classes/TwoFactorTest.php index 48e04cb3bc..45cae8343a 100644 --- a/test/classes/TwoFactorTest.php +++ b/test/classes/TwoFactorTest.php @@ -175,7 +175,7 @@ class TwoFactorTest extends AbstractTestCase $this->assertTrue($object->check()); $this->assertEquals('', $object->render()); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig(['type' => 'db']); $this->loadQueriesForConfigure(''); @@ -216,7 +216,7 @@ class TwoFactorTest extends AbstractTestCase $GLOBALS['cfg']['DBG']['simple2fa'] = true; $object = $this->getTwoFactorAndLoadConfig('user', null); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig([]); $this->loadQueriesForConfigure('simple'); @@ -225,7 +225,7 @@ class TwoFactorTest extends AbstractTestCase $backend = $object->getBackend(); $this->assertEquals('simple', $backend::$id); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig([]); $this->loadQueriesForConfigure(''); @@ -234,14 +234,14 @@ class TwoFactorTest extends AbstractTestCase $backend = $object->getBackend(); $this->assertEquals('', $backend::$id); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->initStorageConfigAndData();// Needs a re-init $GLOBALS['cfg']['DBG']['simple2fa'] = false; $object = $this->getTwoFactorAndLoadConfig('user', null); $this->assertFalse($object->configure('simple')); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } /** @@ -275,7 +275,7 @@ class TwoFactorTest extends AbstractTestCase $google2fa->getTimestamp() ); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig([]); $this->loadQueriesForConfigure('application', [ 'secret' => $object->config['settings']['secret'], @@ -283,7 +283,7 @@ class TwoFactorTest extends AbstractTestCase $this->assertTrue($object->configure('application')); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); unset($_POST['2fa_code']); /* Check code */ @@ -405,7 +405,7 @@ class TwoFactorTest extends AbstractTestCase . 'ZLVGZuelRPU2FOVU9XUXhSZDlUV3o1YUZPZzgiLCAib3JpZ2luIjogImh0dHA6XC9cL2RlbW8uZXhhbXB' . 'sZS5jb20iLCAidHlwIjogIm5hdmlnYXRvci5pZC5maW5pc2hFbnJvbGxtZW50IiB9", "errorCode": 0 }'; - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig([]); $this->loadQueriesForConfigure('key', [ 'registrations' => [ @@ -454,7 +454,7 @@ class TwoFactorTest extends AbstractTestCase . 'yejRmVWpnYzBRN2ciLCAib3JpZ2luIjogImh0dHA6XC9cL2RlbW8uZXhhbXBsZS5jb20iLCAidHlwI' . 'jogIm5hdmlnYXRvci5pZC5nZXRBc3NlcnRpb24iIH0=", "keyHandle": "CTUayZo8hCBeC-sGQJC' . 'hC0wW-bBg99bmOlGCgw8XGq4dLsxO3yWh9mRYArZxocP5hBB1pEGB3bbJYiM-5acc5w", "errorCode": 0 }'; - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); $this->loadResultForConfig([]); $this->loadQueriesForConfigure('key', [ 'registrations' => [ @@ -481,7 +481,7 @@ class TwoFactorTest extends AbstractTestCase ], ]); $this->assertTrue($object->check(true)); - $this->assertAllQueriesConsumed(); + $this->dummyDbi->assertAllQueriesConsumed(); } /** |