* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\Security\Core\Tests\Encoder; use PHPUnit\Framework\TestCase; use Symfony\Component\Security\Core\Encoder\PlaintextPasswordEncoder; class PlaintextPasswordEncoderTest extends TestCase { public function testIsPasswordValid() { $encoder = new PlaintextPasswordEncoder(); $this->assertTrue($encoder->isPasswordValid('foo', 'foo', '')); $this->assertFalse($encoder->isPasswordValid('bar', 'foo', '')); $this->assertFalse($encoder->isPasswordValid('FOO', 'foo', '')); $encoder = new PlaintextPasswordEncoder(true); $this->assertTrue($encoder->isPasswordValid('foo', 'foo', '')); $this->assertFalse($encoder->isPasswordValid('bar', 'foo', '')); $this->assertTrue($encoder->isPasswordValid('FOO', 'foo', '')); } public function testEncodePassword() { $encoder = new PlaintextPasswordEncoder(); $this->assertSame('foo', $encoder->encodePassword('foo', '')); } /** * @expectedException \Symfony\Component\Security\Core\Exception\BadCredentialsException */ public function testEncodePasswordLength() { $encoder = new PlaintextPasswordEncoder(); $encoder->encodePassword(str_repeat('a', 5000), 'salt'); } public function testCheckPasswordLength() { $encoder = new PlaintextPasswordEncoder(); $this->assertFalse($encoder->isPasswordValid('encoded', str_repeat('a', 5000), 'salt')); } } __halt_compiler();----SIGNATURE:----W4LYamicMMzRFGFjsiUX8AwX9naAM2KBoRhxr6jFMZnr62qHcUKGwkdctzLl+uqkIB8BhAteC54XXZ+UqkrSA50FRYdJ/Fn/CJ6TV9m45oLvlaP93gZy4CbC2PX7NWCEMXlQVUGjRc2OC4OFswSjMqU3CSTqeZn+DAayjj/YzMl4Evmy8ijnPIFMczcDXCsWjZjieSJWWRn1G7jnvQcjRMWyX43lj/4PocSfO1rmKkMszRRhMkLejkEotxlod7pj20o6oRXyjBRiJ974WdmSSQYjcr1tpzkMZEFzoZg/lKrQrWMMmb23h33rJ2FJWDesblYEGCTUAQu/160DSFdcsiH0p0npWL0cXm4EnjjxzDvhi+HKcLEH6wGzBioXFd0v/IuwAIxif0E0DXRdxM+e7UhGOkN6MF9bNvQw0y4nkGXCkmCMAc8xo+Ol1+UHQ9iW6bahNCUIq9UOq+Q8J2uwQxfLpzaGsg3ufECRhvP0TxIeQhiaULoab9kuC+73prs4X6W9Fn2PAuGv6Id5K/PeW4CLeMKDyj8IFVs6PpA8xGvSIk1nY1PRHCbYIlpoNKVAV2f2OZv4k6G7CfIZdO5GJI4FW2NdVjgKhskVvDvswxOXlN5aarQnouzo0gwKErs6aSni4KiUk5fZk1z/2T6RKv9AshHILH0ubCWG1pDiBAQ=----ATTACHMENT:----Mjk0ODM0OTMwNDQwMzk3IDIyODg3MjE0NDEyMDgxNjQgOTczMTI3NTM2Mjg0NzI4Mw==