Skip to content

Commit 72a6947

Browse files
committed
Remove the AbstractTestCase::assertAllSelectsConsumed method
Uses the DummyDbi method instead. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
1 parent 4930c7a commit 72a6947

25 files changed

Lines changed: 38 additions & 48 deletions

test/classes/AbstractTestCase.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,6 @@ protected function setUp(): void
102102
Cache::purge();
103103
}
104104

105-
protected function assertAllSelectsConsumed(): void
106-
{
107-
$unUsedSelects = $this->dummyDbi->getUnUsedDatabaseSelects();
108-
$this->assertSame(
109-
[],
110-
$unUsedSelects,
111-
'Some database selects where not used !'
112-
);
113-
}
114-
115105
protected function loadContainerBuilder(): void
116106
{
117107
$GLOBALS['containerBuilder'] = Core::getContainerBuilder();

test/classes/BookmarkTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function testGetList(): void
4747
'sakila'
4848
);
4949
$this->assertContainsOnlyInstancesOf(Bookmark::class, $actual);
50-
$this->assertAllSelectsConsumed();
50+
$this->dummyDbi->assertAllSelectsConsumed();
5151
}
5252

5353
/**
@@ -64,7 +64,7 @@ public function testGet(): void
6464
'1'
6565
)
6666
);
67-
$this->assertAllSelectsConsumed();
67+
$this->dummyDbi->assertAllSelectsConsumed();
6868
}
6969

7070
/**
@@ -83,6 +83,6 @@ public function testSave(): void
8383
$this->assertNotFalse($bookmark);
8484
$this->dummyDbi->addSelectDb('phpmyadmin');
8585
$this->assertFalse($bookmark->save());
86-
$this->assertAllSelectsConsumed();
86+
$this->dummyDbi->assertAllSelectsConsumed();
8787
}
8888
}

test/classes/Controllers/Import/ImportControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public function testIndexParametrized(): void
5858
$this->dummyDbi->addSelectDb('pma_test');
5959
$this->dummyDbi->addSelectDb('pma_test');
6060
$importController();
61-
$this->assertAllSelectsConsumed();
61+
$this->dummyDbi->assertAllSelectsConsumed();
6262
$this->assertResponseWasSuccessfull();
6363

6464
$this->assertStringContainsString(

test/classes/Controllers/NormalizationControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function testCreateNewTables2NF(): void
141141
$normalizationController = $GLOBALS['containerBuilder']->get(NormalizationController::class);
142142
$this->dummyDbi->addSelectDb('my_db');
143143
$normalizationController();
144-
$this->assertAllSelectsConsumed();
144+
$this->dummyDbi->assertAllSelectsConsumed();
145145

146146
$this->assertResponseWasSuccessfull();
147147

@@ -179,7 +179,7 @@ public function testCreateNewTables3NF(): void
179179
$normalizationController = $GLOBALS['containerBuilder']->get(NormalizationController::class);
180180
$this->dummyDbi->addSelectDb('my_db');
181181
$normalizationController();
182-
$this->assertAllSelectsConsumed();
182+
$this->dummyDbi->assertAllSelectsConsumed();
183183

184184
$this->assertResponseWasSuccessfull();
185185

test/classes/Controllers/Server/BinlogControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testIndex(): void
4848
$_POST['pos'] = '3';
4949
$this->dummyDbi->addSelectDb('mysql');
5050
$controller();
51-
$this->assertAllSelectsConsumed();
51+
$this->dummyDbi->assertAllSelectsConsumed();
5252
$actual = $response->getHTMLResult();
5353

5454
$this->assertStringContainsString('Select binary log to view', $actual);

test/classes/Controllers/Server/CollationsControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testIndexAction(): void
3939

4040
$this->dummyDbi->addSelectDb('mysql');
4141
$controller();
42-
$this->assertAllSelectsConsumed();
42+
$this->dummyDbi->assertAllSelectsConsumed();
4343
$actual = $response->getHTMLResult();
4444

4545
$this->assertStringContainsString('<div><strong>latin1</strong></div>', $actual);

test/classes/Controllers/Server/DatabasesControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function testIndexAction(): void
6161

6262
$this->dummyDbi->addSelectDb('mysql');
6363
$controller();
64-
$this->assertAllSelectsConsumed();
64+
$this->dummyDbi->assertAllSelectsConsumed();
6565
$actual = $response->getHTMLResult();
6666

6767
$this->assertStringContainsString('data-filter-row="SAKILA"', $actual);
@@ -98,7 +98,7 @@ public function testIndexAction(): void
9898

9999
$this->dummyDbi->addSelectDb('mysql');
100100
$controller();
101-
$this->assertAllSelectsConsumed();
101+
$this->dummyDbi->assertAllSelectsConsumed();
102102
$actual = $response->getHTMLResult();
103103

104104
$this->assertStringNotContainsString(__('Enable statistics'), $actual);

test/classes/Controllers/Server/EnginesControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function testIndex(): void
3939

4040
$this->dummyDbi->addSelectDb('mysql');
4141
$controller->__invoke();
42-
$this->assertAllSelectsConsumed();
42+
$this->dummyDbi->assertAllSelectsConsumed();
4343

4444
$actual = $response->getHTMLResult();
4545

test/classes/Controllers/Server/PluginsControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function testIndex(): void
6969
$controller = new PluginsController($response, new Template(), new Plugins($dbi), $GLOBALS['dbi']);
7070
$this->dummyDbi->addSelectDb('mysql');
7171
$controller();
72-
$this->assertAllSelectsConsumed();
72+
$this->dummyDbi->assertAllSelectsConsumed();
7373
$actual = $response->getHTMLResult();
7474

7575
//validate 1:Items

test/classes/Controllers/Server/ShowEngineControllerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testShowEngine(): void
4242
'page' => 'page',
4343
]);
4444

45-
$this->assertAllSelectsConsumed();
45+
$this->dummyDbi->assertAllSelectsConsumed();
4646
$actual = $response->getHTMLResult();
4747

4848
$enginePlugin = StorageEngine::getEngine('Pbxt');

0 commit comments

Comments
 (0)