Skip to content

Commit

Permalink
Update tests to check for APP_ENV
Browse files Browse the repository at this point in the history
  • Loading branch information
flohw committed Jul 17, 2024
1 parent 4168320 commit a2571bb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/Functional/Command/GenerateCronFileCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit a2571bb

Please sign in to comment.