diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-03 11:22:23 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2014-09-03 11:22:23 +0200 |
commit | 3d4d38baad959b20855b0e37bab1fbe66759a7ee (patch) | |
tree | 9e91eb4f0f2ce7e77daea840c60ccc5693332e73 | |
parent | e494f3c32878142cb811934be943e3e844e9d796 (diff) | |
parent | 1b9e95cbb20689db16a5c309faf6fae362417d92 (diff) | |
download | symfony-security-3d4d38baad959b20855b0e37bab1fbe66759a7ee.zip symfony-security-3d4d38baad959b20855b0e37bab1fbe66759a7ee.tar.gz symfony-security-3d4d38baad959b20855b0e37bab1fbe66759a7ee.tar.bz2 |
Merge branch '2.5'
* 2.5:
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')); } } |