Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6617 from Codeception/fix-skip-issues
Fix skip issues
- Loading branch information
Showing
15 changed files
with
274 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<?php | ||
|
||
class RunSkippedCest | ||
{ | ||
public function classLevelSkipAnnotationWithMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit ClassLevelSkipAnnotationWithMessageCest.php'); | ||
$I->seeInShellOutput("S ClassLevelSkipAnnotationWithMessageCest: Method1"); | ||
$I->seeInShellOutput("S ClassLevelSkipAnnotationWithMessageCest: Method2"); | ||
$I->seeInShellOutput('Skip message'); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function classLevelSkipAnnotationWithoutMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit ClassLevelSkipAnnotationWithoutMessageCest.php'); | ||
$I->seeInShellOutput("S ClassLevelSkipAnnotationWithoutMessageCest: Method1"); | ||
$I->seeInShellOutput("S ClassLevelSkipAnnotationWithoutMessageCest: Method2"); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function classLevelSkipAttributeWithMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit ClassLevelSkipAttributeWithMessageCest.php'); | ||
$I->seeInShellOutput("S ClassLevelSkipAttributeWithMessageCest: Method1"); | ||
$I->seeInShellOutput("S ClassLevelSkipAttributeWithMessageCest: Method2"); | ||
$I->seeInShellOutput('Skip message'); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function classLevelSkipAttributeWithoutMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit ClassLevelSkipAttributeWithoutMessageCest.php'); | ||
$I->seeInShellOutput("S ClassLevelSkipAttributeWithoutMessageCest: Method1"); | ||
$I->seeInShellOutput("S ClassLevelSkipAttributeWithoutMessageCest: Method2"); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function methodLevelSkipAnnotationWithMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit MethodLevelSkipAnnotationWithMessageCest.php'); | ||
$I->seeInShellOutput("+ MethodLevelSkipAnnotationWithMessageCest: Method1"); | ||
$I->seeInShellOutput("S MethodLevelSkipAnnotationWithMessageCest: Method2"); | ||
$I->seeInShellOutput('Skip message'); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function methodLevelSkipAnnotationWithoutMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit MethodLevelSkipAnnotationWithoutMessageCest.php'); | ||
$I->seeInShellOutput("+ MethodLevelSkipAnnotationWithoutMessageCest: Method1"); | ||
$I->seeInShellOutput("S MethodLevelSkipAnnotationWithoutMessageCest: Method2"); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function methodLevelSkipAttributeWithMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit MethodLevelSkipAttributeWithMessageCest.php'); | ||
$I->seeInShellOutput("S MethodLevelSkipAttributeWithMessageCest: Method1"); | ||
$I->seeInShellOutput("+ MethodLevelSkipAttributeWithMessageCest: Method2"); | ||
$I->seeInShellOutput('Skip message'); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
|
||
public function methodLevelSkipAttributeWithoutMessage(CliGuy $I): void | ||
{ | ||
$I->amInPath('tests/data/skip'); | ||
$I->executeCommand('run -v --no-ansi unit MethodLevelSkipAttributeWithoutMessageCest.php'); | ||
$I->seeInShellOutput("+ MethodLevelSkipAttributeWithoutMessageCest: Method1"); | ||
$I->seeInShellOutput("S MethodLevelSkipAttributeWithoutMessageCest: Method2"); | ||
$I->seeInShellOutput('OK, but incomplete, skipped, or useless tests!'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
paths: | ||
tests: tests | ||
output: tests/_output | ||
data: tests/_data | ||
support: tests/_support | ||
envs: tests/_envs | ||
actor_suffix: Tester | ||
settings: | ||
colors: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
/** | ||
* Inherited Methods | ||
* @method void wantToTest($text) | ||
* @method void wantTo($text) | ||
* @method self execute($callable) | ||
* @method self expectTo($prediction) | ||
* @method self expect($prediction) | ||
* @method self amGoingTo($argumentation) | ||
* @method self am($role) | ||
* @method self lookForwardTo($achieveValue) | ||
* @method self comment($description) | ||
* @method \Codeception\Lib\Friend haveFriend($name, $actorClass = NULL) | ||
* | ||
* @SuppressWarnings(PHPMD) | ||
*/ | ||
class UnitTester extends \Codeception\Actor | ||
{ | ||
use _generated\UnitTesterActions; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
* | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
actor: UnitTester |
19 changes: 19 additions & 0 deletions
19
tests/data/skip/tests/unit/ClassLevelSkipAnnotationWithMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use UnitTester; | ||
|
||
/** | ||
* @skip Skip message | ||
*/ | ||
class ClassLevelSkipAnnotationWithMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/data/skip/tests/unit/ClassLevelSkipAnnotationWithoutMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use UnitTester; | ||
|
||
/** | ||
* @skip | ||
*/ | ||
class ClassLevelSkipAnnotationWithoutMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/data/skip/tests/unit/ClassLevelSkipAttributeWithMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use Codeception\Attribute\Skip; | ||
use UnitTester; | ||
|
||
#[Skip('Skip message')] | ||
class ClassLevelSkipAttributeWithMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/data/skip/tests/unit/ClassLevelSkipAttributeWithoutMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use Codeception\Attribute\Skip; | ||
use UnitTester; | ||
|
||
#[Skip] | ||
class ClassLevelSkipAttributeWithoutMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/data/skip/tests/unit/MethodLevelSkipAnnotationWithMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use UnitTester; | ||
|
||
class MethodLevelSkipAnnotationWithMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
/** | ||
* @skip Skip message | ||
*/ | ||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
tests/data/skip/tests/unit/MethodLevelSkipAnnotationWithoutMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use UnitTester; | ||
|
||
class MethodLevelSkipAnnotationWithoutMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
/** | ||
* @skip | ||
*/ | ||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/data/skip/tests/unit/MethodLevelSkipAttributeWithMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use Codeception\Attribute\Skip; | ||
use UnitTester; | ||
|
||
class MethodLevelSkipAttributeWithMessageCest | ||
{ | ||
#[Skip('Skip message')] | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
tests/data/skip/tests/unit/MethodLevelSkipAttributeWithoutMessageCest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Unit; | ||
|
||
use Codeception\Attribute\Skip; | ||
use UnitTester; | ||
|
||
class MethodLevelSkipAttributeWithoutMessageCest | ||
{ | ||
public function method1(UnitTester $I) | ||
{ | ||
} | ||
|
||
#[Skip] | ||
public function method2(UnitTester $I) | ||
{ | ||
} | ||
} |