Skip to content

Commit

Permalink
Add return type annotations to setUp etc. examples
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee authored and sebastianbergmann committed Apr 26, 2019
1 parent 2d78db9 commit d20347b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/code-coverage-analysis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ shows an example.
{
protected $ba;
protected function setUp()
protected function setUp(): void
{
$this->ba = new BankAccount;
}
Expand Down
20 changes: 10 additions & 10 deletions src/fixtures.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ assertion method.
{
protected $stack;
protected function setUp()
protected function setUp(): void
{
$this->stack = [];
}
Expand Down Expand Up @@ -101,17 +101,17 @@ case class.
class TemplateMethodsTest extends TestCase
{
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
protected function setUp()
protected function setUp(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
protected function assertPreConditions()
protected function assertPreConditions(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
Expand All @@ -128,22 +128,22 @@ case class.
$this->assertTrue(false);
}
protected function assertPostConditions()
protected function assertPostConditions(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
protected function tearDown()
protected function tearDown(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
fwrite(STDOUT, __METHOD__ . "\n");
}
protected function onNotSuccessfulTest(Exception $e)
protected function onNotSuccessfulTest(Exception $e): void
{
fwrite(STDOUT, __METHOD__ . "\n");
throw $e;
Expand Down Expand Up @@ -247,12 +247,12 @@ database after the last test of the test case, respectively.
{
protected static $dbh;
public static function setUpBeforeClass()
public static function setUpBeforeClass(): void
{
self::$dbh = new PDO('sqlite::memory:');
}
public static function tearDownAfterClass()
public static function tearDownAfterClass(): void
{
self::$dbh = null;
}
Expand Down
2 changes: 1 addition & 1 deletion src/incomplete-and-skipped-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ method to skip the test if it is not.
class DatabaseTest extends TestCase
{
protected function setUp()
protected function setUp(): void
{
if (!extension_loaded('mysqli')) {
$this->markTestSkipped(
Expand Down

0 comments on commit d20347b

Please sign in to comment.