Working state but no uploads
This commit is contained in:
@@ -21,6 +21,7 @@ use PHPUnit\Framework\TestCase;
|
||||
* Les dépendances sont remplacées par des mocks via leurs interfaces pour
|
||||
* isoler le service.
|
||||
*/
|
||||
#[\PHPUnit\Framework\Attributes\AllowMockObjectsWithoutExpectations]
|
||||
final class AuthServiceTest extends TestCase
|
||||
{
|
||||
/** @var UserRepositoryInterface&MockObject */
|
||||
@@ -58,7 +59,7 @@ final class AuthServiceTest extends TestCase
|
||||
$password = 'motdepasse1';
|
||||
$user = $this->makeUser('alice', 'alice@example.com', $password);
|
||||
|
||||
$this->userRepository->method('findByUsername')->with('alice')->willReturn($user);
|
||||
$this->userRepository->expects($this->once())->method('findByUsername')->with('alice')->willReturn($user);
|
||||
|
||||
$result = $this->service->authenticate('alice', $password);
|
||||
|
||||
@@ -73,7 +74,7 @@ final class AuthServiceTest extends TestCase
|
||||
$password = 'motdepasse1';
|
||||
$user = $this->makeUser('alice', 'alice@example.com', $password);
|
||||
|
||||
$this->userRepository->method('findByUsername')->with('alice')->willReturn($user);
|
||||
$this->userRepository->expects($this->once())->method('findByUsername')->with('alice')->willReturn($user);
|
||||
|
||||
$result = $this->service->authenticate('ALICE', $password);
|
||||
|
||||
@@ -116,7 +117,7 @@ final class AuthServiceTest extends TestCase
|
||||
$password = 'ancienmdp1';
|
||||
$user = $this->makeUser('alice', 'alice@example.com', $password, 1);
|
||||
|
||||
$this->userRepository->method('findById')->with(1)->willReturn($user);
|
||||
$this->userRepository->expects($this->once())->method('findById')->with(1)->willReturn($user);
|
||||
$this->userRepository->expects($this->once())->method('updatePassword')->with(1);
|
||||
|
||||
$this->service->changePassword(1, $password, 'nouveaumdp1');
|
||||
|
||||
Reference in New Issue
Block a user