From a2571bba93764d90d3c43960ca913383871d80af Mon Sep 17 00:00:00 2001 From: Florian PARRENO Date: Wed, 17 Jul 2024 09:29:15 +0200 Subject: [PATCH] Update tests to check for APP_ENV --- .../Functional/Command/GenerateCronFileCommandTest.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/Functional/Command/GenerateCronFileCommandTest.php b/Tests/Functional/Command/GenerateCronFileCommandTest.php index 6935548..474b2d3 100644 --- a/Tests/Functional/Command/GenerateCronFileCommandTest.php +++ b/Tests/Functional/Command/GenerateCronFileCommandTest.php @@ -17,11 +17,12 @@ public function testGenerateFullConfiguration() $this->assertSame(0, $tester->execute(['env-mode' => 'staging'])); - $expected = '* * * * * project_staging php7.3 path/to/staging app:test --env=staging'; + $expected = '* * * * * project_staging php7.3 path/to/staging app:test'; $cacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir').'/cron_test'; - $this->assertStringContainsString($expected, file_get_contents($cacheDir)); + $this->assertStringContainsString($expected, $content = file_get_contents($cacheDir)); + $this->assertStringContainsString('APP_ENV=staging', $content); } public function testGenerateEmptyCrons() @@ -52,9 +53,10 @@ public function testDryRun() $this->assertStringContainsString('[OK] Dry run generated', $tester->getDisplay()); $this->assertStringContainsString('# send email', $tester->getDisplay()); $this->assertStringContainsString( - '* * * * * project_staging php7.3 path/to/staging app:test --env=staging', - $tester->getDisplay() + '* * * * * project_staging php7.3 path/to/staging app:test', + $display = $tester->getDisplay() ); + $this->assertStringContainsString('APP_ENV=staging', $display); } public function testCheckExecutivePath()