diff --git a/src/Resources/skeleton/crud/test/Test.tpl.php b/src/Resources/skeleton/crud/test/Test.tpl.php index 8404bec21..d98a9d837 100644 --- a/src/Resources/skeleton/crud/test/Test.tpl.php +++ b/src/Resources/skeleton/crud/test/Test.tpl.php @@ -36,6 +36,8 @@ public function testIndex(): void public function testNew(): void { + $originalNumObjectsInRepository = count($this->repository->findAll()); + $this->markTestIncomplete(); $this->client->request('GET', sprintf('%snew', $this->path)); @@ -47,9 +49,9 @@ public function testNew(): void ]); - self::assertResponseRedirects('/sweet/food/'); + self::assertResponseRedirects('/'); - self::assertSame(1, $this->repository->count([])); + self::assertSame($originalNumObjectsInRepository + 1, count($this->repository->findAll())); } public function testShow(): void @@ -100,6 +102,9 @@ public function testEdit(): void public function testRemove(): void { $this->markTestIncomplete(); + + $originalNumObjectsInRepository = count($this->repository->findAll()); + $fixture = new (); $typeOptions): ?> $fixture->set('My Title'); @@ -107,10 +112,12 @@ public function testRemove(): void $this->repository->add($fixture, true); + self::assertSame($originalNumObjectsInRepository + 1, count($this->repository->findAll())); + $this->client->request('GET', sprintf('%s%s', $this->path, $fixture->getId())); $this->client->submitForm('Delete'); + self::assertSame($originalNumObjectsInRepository, count($this->repository->findAll())); self::assertResponseRedirects('/'); - self::assertSame(0, $this->repository->count([])); } }