forked from moodlehq/moodle-cs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Error for empty setUp/tearDown methods
- Loading branch information
1 parent
6a458cb
commit 4d1a7b4
Showing
5 changed files
with
39 additions
and
16 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 |
---|---|---|
|
@@ -3,19 +3,15 @@ defined('MOODLE_INTERNAL') || die(); // Make this always the 1st line in all CS | |
|
||
class missing_setup_teardown_test extends Something { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
stronk7
|
||
public function setUp(): void { | ||
parent::setUp(); | ||
} | ||
|
||
public function tearDown(): void { | ||
parent::tearDown(); | ||
} | ||
|
||
public static function setUpBeforeClass(): void { | ||
parent::setUpBeforeClass(); | ||
} | ||
|
||
public static function tearDownAfterClass(): void { | ||
parent::tearDownAfterClass(); | ||
} | ||
} | ||
|
||
|
@@ -95,3 +91,10 @@ class best_insertion_setup_teardown_test extends Something { | |
parent::tearDownAfterClass(); | ||
} | ||
} | ||
|
||
class empty_setup_teardown_test extends Something { | ||
public function setUp(): void {} | ||
public function tearDown(): void {} | ||
public static function setUpBeforeClass(): void {} | ||
public static function tearDownAfterClass(): void { } // Same line. | ||
} |
Only suggestion I can imagine… and without modifying line numbers is…
can we rename the test class to no_statement_setup_teardown_test (or so).
and then add some comment or phpdoc block in some of them.
with that, it’s perfect!