/** * @test * * @expectedException Symfony\Component\Security\Core\Exception\AuthenticationServiceException * @expectedExceptionMessage The manager does not implement createUserFromIdentity method. Please extend manager and overwrite the method with your logic. */ public function throwAlwaysWhenCreateUserFromIdentityMethodCalled() { $manager = new UserManager($this->createIdentityManagerMock()); $manager->createUserFromIdentity('an_identity'); }