diff --git a/Resources/views/template.txt.twig b/Resources/views/template.txt.twig index 9e3f9fe..51d8d60 100644 --- a/Resources/views/template.txt.twig +++ b/Resources/views/template.txt.twig @@ -4,6 +4,6 @@ MAILTO="{{ mailto }}" {% for cron in crons %} # {{ cron.name }} -{{ cron.expression }} {{ user }} {{ php_version }} {{ absolute_path }} {{ cron.command }} --env={{ env }} +{{ cron.expression }} {{ user }} APP_ENV={{ env }} {{ php_version }} {{ absolute_path }} {{ cron.command }} {% endfor %} diff --git a/Tests/Functional/Command/GenerateCronFileCommandTest.php b/Tests/Functional/Command/GenerateCronFileCommandTest.php index 6935548..603f783 100644 --- a/Tests/Functional/Command/GenerateCronFileCommandTest.php +++ b/Tests/Functional/Command/GenerateCronFileCommandTest.php @@ -17,7 +17,7 @@ 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 APP_ENV=staging php7.3 path/to/staging app:test'; $cacheDir = $kernel->getContainer()->getParameter('kernel.cache_dir').'/cron_test'; @@ -52,7 +52,7 @@ 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', + '* * * * * project_staging APP_ENV=staging php7.3 path/to/staging app:test', $tester->getDisplay() ); }