Skip to content

Commit f940d92

Browse files
committed
Merge branch '2.5'
* 2.5: Revert "minor #11808 [Security] Add more tests for StringUtils::equals (dunglas)"
2 parents ddc0e86 + 1ec88be commit f940d92

File tree

1 file changed

+3
-41
lines changed

1 file changed

+3
-41
lines changed

src/Symfony/Component/Security/Core/Tests/Util/StringUtilsTest.php

+3-41
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,11 @@
1313

1414
use Symfony\Component\Security\Core\Util\StringUtils;
1515

16-
/**
17-
* Data from PHP.net's hash_equals tests
18-
*/
1916
class StringUtilsTest extends \PHPUnit_Framework_TestCase
2017
{
21-
public function dataProviderTrue()
22-
{
23-
return array(
24-
array('same', 'same'),
25-
array('', ''),
26-
array(123, 123),
27-
array(null, ''),
28-
array(null, null),
29-
);
30-
}
31-
32-
public function dataProviderFalse()
33-
{
34-
return array(
35-
array('not1same', 'not2same'),
36-
array('short', 'longer'),
37-
array('longer', 'short'),
38-
array('', 'notempty'),
39-
array('notempty', ''),
40-
array(123, 'NaN'),
41-
array('NaN', 123),
42-
array(null, 123),
43-
);
44-
}
45-
46-
/**
47-
* @dataProvider dataProviderTrue
48-
*/
49-
public function testEqualsTrue($known, $user)
50-
{
51-
$this->assertTrue(StringUtils::equals($known, $user));
52-
}
53-
54-
/**
55-
* @dataProvider dataProviderFalse
56-
*/
57-
public function testEqualsFalse($known, $user)
18+
public function testEquals()
5819
{
59-
$this->assertFalse(StringUtils::equals($known, $user));
20+
$this->assertTrue(StringUtils::equals('password', 'password'));
21+
$this->assertFalse(StringUtils::equals('password', 'foo'));
6022
}
6123
}

0 commit comments

Comments
 (0)