* * 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:----ei1bcvNs7ZNXc8F9JTDMOabK4ZiS9G9UpREtCQgF1fcHFLPh/4KUM0XOBmBibggSS35I1B+aKWU/R8KBFJFKgZgamZX6mFSwpBqyRqKWegZ3qNW8wVBOqODOjwaFTNQaGHPPEcwMapB42akUs3VM3RLpsy0mFPiDhu8XHXC1FgSMckpkaZh1T/gAZEOuQkRRoHLsshB9026OEijYnpBDkPo0Iaw54ym5pvbrjgT6mDYvkhgft6SmQoJ0Tv1bzUmsqq53PR+HNbCyGke3jypJw2RVdCHpJzjxJEGrYSBtAHN7pR9HYbzlH0roew0qlIDKovr/ktHulV5UpY/WUy0yHBviD1ZlexA6hD0iUxj/UGaTz1u4NOEtySaN/EuZCIDequm+Gf2Cg6/kcRZlfvIU729/XgehvJdEaTtswwpmqeydkPJSTEGdZjHYm0NN/E8o4Dp0/JXILnDMETA321maIRniuWQHRoh51kKQUmiJG2XdT2wLJzoPPiGqSG4ppIEcoF/ZwzLNMhpmLv/QGkA7j4quZsoDEQ7OutfZfR/Fh8uRkRiJFSRLYU3rabg+nqhntpO69jRzWy2r4MzxCqIKi6G/6X0HVqUgD4nfYVS9sO73NQ9jUe5UHaZyiSwyK+7YIkCs5zmEeeUfH1wUj89J/xhC/bCI3NXQnkFBqYegGZ0=----ATTACHMENT:----NzU5Mzk1NzgzODY1NzUxNCA2ODE4Njk2NzY4MjM0MjI5IDgzOTI4NDM1MDAwODQ1ODQ=