diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-03 11:22:15 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-03 11:22:15 +0200 |
commit | 1b9e95cbb20689db16a5c309faf6fae362417d92 (patch) | |
tree | 58209f434c406c574e01005dbf80746fb99b52c7 | |
parent | 12cf9164db2fbbcf3b918cc43810414c10f8230d (diff) | |
parent | 0c51a70c04279663ac6e016efeb31557b28b0c44 (diff) | |
download | symfony-security-1b9e95cbb20689db16a5c309faf6fae362417d92.zip symfony-security-1b9e95cbb20689db16a5c309faf6fae362417d92.tar.gz symfony-security-1b9e95cbb20689db16a5c309faf6fae362417d92.tar.bz2 |
Merge branch '2.4' into 2.5v2.5.4
* 2.4:
Revert "minor #11808 [Security] Add more tests for StringUtils::equals (dunglas)"
-rw-r--r-- | Core/Tests/Util/StringUtilsTest.php | 44 |
1 files changed, 3 insertions, 41 deletions
diff --git a/Core/Tests/Util/StringUtilsTest.php b/Core/Tests/Util/StringUtilsTest.php index e0366a5..89da98d 100644 --- a/Core/Tests/Util/StringUtilsTest.php +++ b/Core/Tests/Util/StringUtilsTest.php @@ -13,49 +13,11 @@ namespace Symfony\Component\Security\Core\Tests\Util; use Symfony\Component\Security\Core\Util\StringUtils; -/** - * Data from PHP.net's hash_equals tests - */ class StringUtilsTest extends \PHPUnit_Framework_TestCase { - public function dataProviderTrue() - { - return array( - array('same', 'same'), - array('', ''), - array(123, 123), - array(null, ''), - array(null, null), - ); - } - - public function dataProviderFalse() - { - return array( - array('not1same', 'not2same'), - array('short', 'longer'), - array('longer', 'short'), - array('', 'notempty'), - array('notempty', ''), - array(123, 'NaN'), - array('NaN', 123), - array(null, 123), - ); - } - - /** - * @dataProvider dataProviderTrue - */ - public function testEqualsTrue($known, $user) - { - $this->assertTrue(StringUtils::equals($known, $user)); - } - - /** - * @dataProvider dataProviderFalse - */ - public function testEqualsFalse($known, $user) + public function testEquals() { - $this->assertFalse(StringUtils::equals($known, $user)); + $this->assertTrue(StringUtils::equals('password', 'password')); + $this->assertFalse(StringUtils::equals('password', 'foo')); } } |