Skip to content

Commit

Permalink
Fixed failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Verest committed Nov 9, 2021
1 parent 29cd2d1 commit 20eddd5
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 15 deletions.
8 changes: 4 additions & 4 deletions tests/cli/RunCest.php
Expand Up @@ -298,19 +298,19 @@ public function runOneGroupWithDataProviders(\CliGuy $I)

public function runTestWithFailFastDefault(\CliGuy $I)
{
$I->executeCommand('run unit --skip-group error --no-exit');
$I->executeCommand('run unit --skip-group error --skip-group multiple-fail --no-exit');
$I->seeInShellOutput('FailingTest: Me');
$I->seeInShellOutput("PassingTest: Me");
$I->executeCommand('run unit --fail-fast --skip-group error --no-exit');
$I->executeCommand('run unit --fail-fast --skip-group error --skip-group multiple-fail --no-exit');
$I->seeInShellOutput('There was 1 failure');
$I->dontSeeInShellOutput("PassingTest: Me");
}

public function runTestWithFailFastCustom(\CliGuy $I)
{
$I->executeCommand('run unit tests/unit/FailingTest.php --fail-fast=2 --no-exit');
$I->executeCommand('run unit MultipleFailingTest.php --fail-fast=2 --no-exit');
$I->seeInShellOutput('There were 2 failures');
$I->executeCommand('run unit tests/unit/FailingTest.php --no-exit');
$I->executeCommand('run unit MultipleFailingTest.php --no-exit');
$I->seeInShellOutput('There were 3 failures');
}

Expand Down
12 changes: 1 addition & 11 deletions tests/data/claypit/tests/unit/FailingTest.php
Expand Up @@ -6,14 +6,4 @@ public function testMe()
{
$this->assertFalse(true);
}

public function testMeTwo()
{
$this->assertFalse(true);
}

public function testMeThree()
{
$this->assertFalse(true);
}
}
}
22 changes: 22 additions & 0 deletions tests/data/claypit/tests/unit/MultipleFailingTest.php
@@ -0,0 +1,22 @@
<?php

/**
* @group multiple-fail
*/
class MultipleFailingTest extends \PHPUnit\Framework\TestCase
{
public function testMe()
{
$this->assertFalse(true);
}

public function testMeTwo()
{
$this->assertFalse(true);
}

public function testMeThree()
{
$this->assertFalse(true);
}
}

0 comments on commit 20eddd5

Please sign in to comment.