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:
authorLuca Perna <12624410+MrMadClown@users.noreply.github.com>2022-10-29 19:24:19 +0300
committerGitHub <noreply@github.com>2022-10-29 19:24:19 +0300
commit4540d6ead0630b0fb959e7a1f44eae8b319ee90e (patch)
treed53b5e0941a574c2dcc31ad008db8f963a332699 /test
parentea5a541f7b9132cd27c0f626a4efb85d33c4ffb8 (diff)
Ref #16276 - Reduce the usage of SuperGlobals in Tracking and UserPassword (#17820)
* 16276 - Reduce the usage of SuperGlobals in Tracking and UserPassword Signed-off-by: Luca Perna <luca@perna.rocks> * 16276 - minor code style refactorings Signed-off-by: Luca Perna <luca@perna.rocks> Signed-off-by: Luca Perna <luca@perna.rocks> Co-authored-by: Luca Perna <luca@perna.rocks>
Diffstat (limited to 'test')
-rw-r--r--test/classes/TrackingTest.php2
-rw-r--r--test/classes/UserPasswordTest.php28
2 files changed, 17 insertions, 13 deletions
diff --git a/test/classes/TrackingTest.php b/test/classes/TrackingTest.php
index 6f30fa4c7a..8e99787866 100644
--- a/test/classes/TrackingTest.php
+++ b/test/classes/TrackingTest.php
@@ -599,7 +599,7 @@ class TrackingTest extends AbstractTestCase
$filter_ts_to = 9999999999;
$filter_ts_from = 0;
- $entries = $this->tracking->getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users);
+ $entries = $this->tracking->getEntries($data, $filter_ts_from, $filter_ts_to, $filter_users, 'schema');
$this->assertEquals('username3', $entries[0]['username']);
$this->assertEquals('statement1', $entries[0]['statement']);
}
diff --git a/test/classes/UserPasswordTest.php b/test/classes/UserPasswordTest.php
index 97ba76fc2d..ff4817a50b 100644
--- a/test/classes/UserPasswordTest.php
+++ b/test/classes/UserPasswordTest.php
@@ -44,14 +44,18 @@ class UserPasswordTest extends AbstractTestCase
public function testSetChangePasswordMsg(
bool $error,
Message $message,
- string $noPassword,
+ bool $noPassword,
string $password,
string $passwordConfirmation
): void {
- $_POST['nopass'] = $noPassword;
- $_POST['pma_pw'] = $password;
- $_POST['pma_pw2'] = $passwordConfirmation;
- $this->assertEquals(['error' => $error, 'msg' => $message], $this->object->setChangePasswordMsg());
+ $this->assertEquals(
+ ['error' => $error, 'msg' => $message],
+ $this->object->setChangePasswordMsg(
+ $password,
+ $passwordConfirmation,
+ $noPassword
+ )
+ );
}
/**
@@ -60,16 +64,16 @@ class UserPasswordTest extends AbstractTestCase
public function providerSetChangePasswordMsg(): array
{
return [
- [false, Message::success('The profile has been updated.'), '1', '', ''],
- [true, Message::error('The password is empty!'), '0', '', ''],
- [true, Message::error('The password is empty!'), '0', 'a', ''],
- [true, Message::error('The password is empty!'), '0', '', 'a'],
- [true, Message::error('The passwords aren\'t the same!'), '0', 'a', 'b'],
- [true, Message::error('Password is too long!'), '0', str_repeat('a', 257), str_repeat('a', 257)],
+ [false, Message::success('The profile has been updated.'), true, '', ''],
+ [true, Message::error('The password is empty!'), false, '', ''],
+ [true, Message::error('The password is empty!'), false, 'a', ''],
+ [true, Message::error('The password is empty!'), false, '', 'a'],
+ [true, Message::error('The passwords aren\'t the same!'), false, 'a', 'b'],
+ [true, Message::error('Password is too long!'), false, str_repeat('a', 257), str_repeat('a', 257)],
[
false,
Message::success('The profile has been updated.'),
- '0',
+ false,
str_repeat('a', 256),
str_repeat('a', 256),
],