Mock nodeStorage
> TypeError: uasort(): Argument #1 ($array) must be of type array, null given
This commit is contained in:
parent
0c162ed08e
commit
09f7f528b9
|
@ -13,9 +13,12 @@ final class PostNodeRepositoryUnitTest extends UnitTestCase {
|
|||
|
||||
/** @test */
|
||||
public function it_returns_posts(): void {
|
||||
$repository = new PostNodeRepository(
|
||||
$this->createMock(EntityTypeManagerInterface::class),
|
||||
);
|
||||
$nodeStorage = $this->createMock(EntityStorageInterface::class);
|
||||
|
||||
$entityTypeManager = $this->createMock(EntityTypeManagerInterface::class);
|
||||
$entityTypeManager->method('getStorage')->with('node')->willReturn($nodeStorage);
|
||||
|
||||
$repository = new PostNodeRepository($entityTypeManager);
|
||||
|
||||
$repository->findAll();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue