Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make dry-run work with module methods having return types
- Loading branch information
1 parent
1316cdc
commit f53fa03
Showing
11 changed files
with
219 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
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
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,43 @@ | ||
<?php | ||
namespace Helper; | ||
|
||
// here you can define custom actions | ||
// all public methods declared in helper class will be available in $I | ||
|
||
class Unit extends \Codeception\Module | ||
{ | ||
public function seeSomething(): void | ||
{ | ||
|
||
} | ||
|
||
public function getInt(): int | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
|
||
public function getDomDocument(): \DOMDocument | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
|
||
public function getUnion(): int|\DOMDocument | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
|
||
public function getIntersection(): \Iterator&\Countable&\DOMDocument | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
|
||
public function getSelf(): self | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
|
||
public function getParent(): parent | ||
{ | ||
throw new \RuntimeException(__METHOD__ . ' should not be executed'); | ||
} | ||
} |
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,6 @@ | ||
<?php | ||
|
||
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,4 @@ | ||
actor: UnitTester | ||
modules: | ||
enabled: | ||
- \Helper\Unit |
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,16 @@ | ||
<?php | ||
|
||
class UseTypedHelperCest | ||
{ | ||
public function executeActions(UnitTester $I) | ||
{ | ||
$I->comment('print comment'); | ||
$I->getInt(); | ||
$I->getDomDocument(); | ||
$I->seeSomething(); | ||
$I->getUnion(); | ||
$I->getIntersection(); | ||
$I->getSelf(); | ||
$I->getParent(); | ||
} | ||
} |