/** * It should detect already hashed passwords. * * @dataProvider providePreSaveAlreadyHashed */ public function testOnPreSavePasswordAlreadyHashed($hash) { $this->storageEvent->getContent()->willReturn($this->user->reveal()); $this->user->getPassword()->willReturn($hash); $this->passwordFactory->createHash(Argument::cetera())->shouldNotBeCalled(); $this->user->setPassword($hash)->shouldBeCalled(); $this->listener->onUserEntityPreSave($this->storageEvent->reveal()); }