aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-11-01 16:15:25 +0100
committerMarc Alexander <admin@m-a-styles.de>2019-11-16 16:02:44 +0100
commit0cbe05faadfade06737f3f057fb1b9aa44a78693 (patch)
treed72f28d1e010f5493edb0d2c3380821443796668 /tests/auth
parent[ticket/12574] Clean up dependencies of db auth provider (diff)
downloadphpbb-0cbe05faadfade06737f3f057fb1b9aa44a78693.tar.gz
phpbb-0cbe05faadfade06737f3f057fb1b9aa44a78693.tar.bz2
phpbb-0cbe05faadfade06737f3f057fb1b9aa44a78693.zip
[ticket/12574] Remove special cases for PHP < 5.3.7
PHPBB3-12574
Diffstat (limited to 'tests/auth')
-rw-r--r--tests/auth/fixtures/user_533.xml39
-rw-r--r--tests/auth/provider_db_test.php21
2 files changed, 3 insertions, 57 deletions
diff --git a/tests/auth/fixtures/user_533.xml b/tests/auth/fixtures/user_533.xml
deleted file mode 100644
index 9731e4db4a..0000000000
--- a/tests/auth/fixtures/user_533.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" ?>
-<dataset>
- <table name="phpbb_users">
- <column>user_id</column>
- <column>username</column>
- <column>username_clean</column>
- <column>user_password</column>
- <column>user_passchg</column>
- <column>user_email</column>
- <column>user_type</column>
- <column>user_login_attempts</column>
- <column>user_permissions</column>
- <column>user_sig</column>
- <row>
- <value>1</value>
- <value>foobar</value>
- <value>foobar</value>
- <value>$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi</value>
- <value>0</value>
- <value>example@example.com</value>
- <value>0</value>
- <value>0</value>
- <value></value>
- <value></value>
- </row>
- <row>
- <value>2</value>
- <value>foobar2</value>
- <value>foobar2</value>
- <value>$H$9E45lK6J8nLTSm9oJE5aNCSTFK9wqa/</value>
- <value>0</value>
- <value>example@example.com</value>
- <value>0</value>
- <value>0</value>
- <value></value>
- <value></value>
- </row>
- </table>
-</dataset>
diff --git a/tests/auth/provider_db_test.php b/tests/auth/provider_db_test.php
index 2c467518f5..8305e7caa4 100644
--- a/tests/auth/provider_db_test.php
+++ b/tests/auth/provider_db_test.php
@@ -15,14 +15,7 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
{
public function getDataSet()
{
- if ((version_compare(PHP_VERSION, '5.3.7', '<')))
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user_533.xml');
- }
- else
- {
- return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
- }
+ return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
}
public function test_login()
@@ -66,14 +59,7 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
$captcha_factory = $phpbb_container->get('captcha.factory');
$provider = new \phpbb\auth\provider\db($captcha_factory, $config, $db, $passwords_manager, $request, $user, $phpbb_root_path, $phpEx);
- if (version_compare(PHP_VERSION, '5.3.7', '<'))
- {
- $password_hash = '$2a$10$e01Syh9PbJjUkio66eFuUu4FhCE2nRgG7QPc1JACalsPXcIuG2bbi';
- }
- else
- {
- $password_hash = '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i';
- }
+ $password_hash = '$2y$10$4RmpyVu2y8Yf/lP3.yQBquKvE54TCUuEDEBJYY6FDDFN3LcbCGz9i';
$expected = array(
'status' => LOGIN_SUCCESS,
@@ -100,7 +86,6 @@ class phpbb_auth_provider_db_test extends phpbb_database_test_case
// Check if convert works
$login_return = $provider->login('foobar2', 'example');
- $password_start = (version_compare(PHP_VERSION, '5.3.7', '<')) ? '$2a$10$' : '$2y$10$';
- $this->assertStringStartsWith($password_start, $login_return['user_row']['user_password']);
+ $this->assertStringStartsWith('$2y$10$', $login_return['user_row']['user_password']);
}
}