Working state
This commit is contained in:
@@ -128,7 +128,7 @@ final class UserRepositoryTest extends TestCase
|
||||
public function testFindByIdReturnsNullWhenMissing(): void
|
||||
{
|
||||
$stmt = $this->stmtForRead(row: false);
|
||||
$this->db->method('prepare')->willReturn($stmt);
|
||||
$this->db->expects($this->once())->method('prepare')->willReturn($stmt);
|
||||
|
||||
$this->assertNull($this->repository->findById(99));
|
||||
}
|
||||
@@ -139,7 +139,7 @@ final class UserRepositoryTest extends TestCase
|
||||
public function testFindByIdReturnsUserWhenFound(): void
|
||||
{
|
||||
$stmt = $this->stmtForRead(row: $this->rowAlice);
|
||||
$this->db->method('prepare')->willReturn($stmt);
|
||||
$this->db->expects($this->once())->method('prepare')->willReturn($stmt);
|
||||
|
||||
$result = $this->repository->findById(1);
|
||||
|
||||
@@ -153,7 +153,7 @@ final class UserRepositoryTest extends TestCase
|
||||
public function testFindByIdQueriesWithCorrectId(): void
|
||||
{
|
||||
$stmt = $this->stmtForRead(row: false);
|
||||
$this->db->method('prepare')->willReturn($stmt);
|
||||
$this->db->expects($this->once())->method('prepare')->willReturn($stmt);
|
||||
|
||||
$stmt->expects($this->once())
|
||||
->method('execute')
|
||||
|
||||
Reference in New Issue
Block a user