SecondTestIsExecutedWhenTheFirstTestFailsCest.php 1.1 KB

1234567891011121314151617181920212223242526272829
  1. <?php
  2. class SecondTestIsExecutedWhenTheFirstTestFailsCest
  3. {
  4. public function testIsExecuted(CliGuy $I)
  5. {
  6. $I->wantTo('see that the second test is executed');
  7. $I->amInPath('tests/data/first_test_fails');
  8. $I->executeFailCommand('run --xml --no-ansi');
  9. $I->seeInShellOutput('Tests: 2, Assertions: 1, Errors: 1');
  10. $I->seeInShellOutput('E twoTestsCest: Failing');
  11. $I->seeInShellOutput('+ twoTestsCest: Successful');
  12. }
  13. public function endTestEventIsEmitted(CliGuy $I)
  14. {
  15. if (\PHPUnit\Runner\Version::series() >= 7) {
  16. throw new \Codeception\Exception\Skip('Not for PHPUnit 7');
  17. }
  18. $I->wantTo('see that all start and end events are emitted');
  19. $I->amInPath('tests/data/first_test_fails');
  20. $I->executeFailCommand('run --xml --no-ansi --report -o "reporters: report: CustomReporter"');
  21. $I->seeInShellOutput('STARTED: twoTestsCest: Failing');
  22. $I->seeInShellOutput('ENDED: twoTestsCest: Failing');
  23. $I->seeInShellOutput('STARTED: twoTestsCest: Successful');
  24. $I->seeInShellOutput('ENDED: twoTestsCest: Successful');
  25. }
  26. }