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>2022-11-06 23:01:07 +0300
committerGitHub <noreply@github.com>2022-11-06 23:01:07 +0300
commit456be438ea2f000988d4fb654d6159a127edc24c (patch)
tree909755d4c7b63a4406b14770d4948b0cb8ad5dfa /test
parentdc3dc0d5f11864c18c66ae9ecf3041aa10ae43f6 (diff)
parentaa3b4ed737f8965b609843a6f722ce9a1fbef877 (diff)
Merge pull request #17872 from kamil-tekiela/Remove-$params-2
Refactoring of Processes.php
Diffstat (limited to 'test')
-rw-r--r--test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php17
-rw-r--r--test/classes/Controllers/Server/Status/ProcessesControllerTest.php31
2 files changed, 34 insertions, 14 deletions
diff --git a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php
index 5fccaacb01..b1b1f318f1 100644
--- a/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php
+++ b/test/classes/Controllers/Server/Status/Processes/RefreshControllerTest.php
@@ -66,11 +66,18 @@ class RefreshControllerTest extends AbstractTestCase
new Processes($GLOBALS['dbi'])
);
- $_POST['full'] = '1';
- $_POST['order_by_field'] = 'process';
- $_POST['sort_order'] = 'DESC';
-
- $controller($this->createStub(ServerRequest::class));
+ $request = $this->createStub(ServerRequest::class);
+ $request->method('getParsedBodyParam')->willReturnMap([
+ ['column_name', '', ''],
+ ['order_by_field', '', 'process'],
+ ['sort_order', '', 'DESC'],
+ ]);
+ $request->method('hasBodyParam')->willReturnMap([
+ ['full', true],
+ ['showExecuting', false],
+ ]);
+
+ $controller($request);
$html = $response->getHTMLResult();
$this->assertStringContainsString('index.php?route=/server/status/processes', $html);
diff --git a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php
index a0ddb6e27c..6bd6dc4414 100644
--- a/test/classes/Controllers/Server/Status/ProcessesControllerTest.php
+++ b/test/classes/Controllers/Server/Status/ProcessesControllerTest.php
@@ -87,13 +87,19 @@ class ProcessesControllerTest extends AbstractTestCase
$this->assertStringContainsString('Show full queries', $html);
$this->assertStringContainsString('index.php?route=/server/status/processes', $html);
- $_POST['full'] = '1';
- $_POST['column_name'] = 'Database';
- $_POST['order_by_field'] = 'Db';
- $_POST['sort_order'] = 'ASC';
+ $request = $this->createStub(ServerRequest::class);
+ $request->method('getParsedBodyParam')->willReturnMap([
+ ['column_name', '', 'Database'],
+ ['order_by_field', '', 'Db'],
+ ['sort_order', '', 'ASC'],
+ ]);
+ $request->method('hasBodyParam')->willReturnMap([
+ ['full', true],
+ ['showExecuting', false],
+ ]);
$this->dummyDbi->addSelectDb('mysql');
- $controller($this->createStub(ServerRequest::class));
+ $controller($request);
$this->dummyDbi->assertAllSelectsConsumed();
$html = $response->getHTMLResult();
@@ -101,12 +107,19 @@ class ProcessesControllerTest extends AbstractTestCase
$this->assertStringContainsString('Database', $html);
$this->assertStringContainsString('DESC', $html);
- $_POST['column_name'] = 'Host';
- $_POST['order_by_field'] = 'Host';
- $_POST['sort_order'] = 'DESC';
+ $request = $this->createStub(ServerRequest::class);
+ $request->method('getParsedBodyParam')->willReturnMap([
+ ['column_name', '', 'Host'],
+ ['order_by_field', '', 'Host'],
+ ['sort_order', '', 'DESC'],
+ ]);
+ $request->method('hasBodyParam')->willReturnMap([
+ ['full', true],
+ ['showExecuting', false],
+ ]);
$this->dummyDbi->addSelectDb('mysql');
- $controller($this->createStub(ServerRequest::class));
+ $controller($request);
$this->dummyDbi->assertAllSelectsConsumed();
$html = $response->getHTMLResult();