Skip to content

Commit dff2f97

Browse files
committed
Fixing look up of Symfony version + removing incorrect renderForm() on 2x assertion methods
1 parent c3b506d commit dff2f97

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

tests/Maker/MakeCrudTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,9 +176,8 @@ public function getTestDetails(): \Generator
176176
$this->assertStringContainsString('src/Form/SweetFoodType.php', $output);
177177

178178
$this->runCrudTest($runner, 'it_generates_basic_crud.php');
179-
180179
self::assertFileEquals(
181-
sprintf('%s/fixtures/make-crud/expected/WithCustomRepository%s.php', \dirname(__DIR__), Kernel::VERSION_ID < 60200 ? 'Legacy' : ''),
180+
sprintf('%s/fixtures/make-crud/expected/WithCustomRepository%s.php', \dirname(__DIR__), $runner->getSymfonyVersion() < 60200 ? 'Legacy' : ''),
182181
$runner->getPath('src/Controller/SweetFoodController.php')
183182
);
184183
}),

tests/fixtures/make-crud/expected/WithCustomRepositoryLegacy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class SweetFoodController extends AbstractController
1717
#[Route('/', name: 'app_sweet_food_index', methods: ['GET'])]
1818
public function index(SweetFoodRepository $sweetFoodRepository): Response
1919
{
20-
return $this->renderForm('sweet_food/index.html.twig', [
20+
return $this->render('sweet_food/index.html.twig', [
2121
'sweet_foods' => $sweetFoodRepository->findAll(),
2222
]);
2323
}
@@ -45,7 +45,7 @@ public function new(Request $request, EntityManagerInterface $entityManager): Re
4545
#[Route('/{id}', name: 'app_sweet_food_show', methods: ['GET'])]
4646
public function show(SweetFood $sweetFood): Response
4747
{
48-
return $this->renderForm('sweet_food/show.html.twig', [
48+
return $this->render('sweet_food/show.html.twig', [
4949
'sweet_food' => $sweetFood,
5050
]);
5151
}

0 commit comments

Comments
 (0)