public function testGetEncoderWithGenericAccount() { $genericFactory = $this->getMock('Symfony\\Component\\Security\\Core\\Encoder\\EncoderFactoryInterface'); $encoder = $this->getMock('Symfony\\Component\\Security\\Core\\Encoder\\PasswordEncoderInterface'); $genericFactory->expects($this->once())->method('getEncoder')->will($this->returnValue($encoder)); $factory = new EncoderFactory(null, false, 1, $genericFactory); $this->assertSame($encoder, $factory->getEncoder($this->getMock('Symfony\\Component\\Security\\Core\\User\\AccountInterface'))); }