Skip to content

Commit

Permalink
Merge branch '8.5' into 9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Dec 13, 2021
2 parents 02eb251 + ba467f3 commit 09f082e
Show file tree
Hide file tree
Showing 11 changed files with 76 additions and 76 deletions.
6 changes: 3 additions & 3 deletions .phive/phars.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpab" version="^1.25" installed="1.26.3" location="./tools/phpab" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.3.2" location="./tools/php-cs-fixer" copy="true"/>
<phar name="php-cs-fixer" version="^3.0" installed="3.4.0" location="./tools/php-cs-fixer" copy="true"/>
<phar name="phpdox" version="^0.12" installed="0.12.0" location="./tools/phpdox" copy="true"/>
<phar name="phploc" version="^4.0" installed="4.0.1" location="./tools/phploc" copy="true"/>
<phar name="psalm" version="^4.0" installed="4.13.1" location="./tools/psalm" copy="true"/>
<phar name="psalm" version="^4.0" installed="4.15.0" location="./tools/psalm" copy="true"/>
<phar name="humbug/php-scoper" version="^0.15.0" installed="0.15.0" location="./tools/php-scoper" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.1.12" location="./tools/composer" copy="true"/>
<phar name="composer" version="^2.0.3" installed="2.2.0-RC1" location="./tools/composer" copy="true"/>
</phive>
36 changes: 18 additions & 18 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,24 @@ protected function setUp(): void
{
}

/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}

/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}

/**
* This method is called after each test.
*/
Expand Down Expand Up @@ -1955,24 +1973,6 @@ protected function createResult(): TestResult
return new TestResult;
}

/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between setUp() and test.
*/
protected function assertPreConditions(): void
{
}

/**
* Performs assertions shared by all tests of a test case.
*
* This method is called between test and tearDown().
*/
protected function assertPostConditions(): void
{
}

/**
* This method is called when a test method did not execute successfully.
*
Expand Down
20 changes: 10 additions & 10 deletions tests/_files/ExceptionInAssertPostConditionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ protected function setUp(): void
$this->setUp = true;
}

protected function tearDown(): void
{
$this->tearDown = true;
}

public function testSomething(): void
{
$this->testSomething = true;
}

protected function assertPreConditions(): void
{
$this->assertPreConditions = true;
Expand All @@ -50,4 +40,14 @@ protected function assertPostConditions(): void

throw new Exception;
}

protected function tearDown(): void
{
$this->tearDown = true;
}

public function testSomething(): void
{
$this->testSomething = true;
}
}
20 changes: 10 additions & 10 deletions tests/_files/ExceptionInAssertPreConditionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@ protected function setUp(): void
$this->setUp = true;
}

protected function tearDown(): void
{
$this->tearDown = true;
}

public function testSomething(): void
{
$this->testSomething = true;
}

protected function assertPreConditions(): void
{
$this->assertPreConditions = true;
Expand All @@ -50,4 +40,14 @@ protected function assertPostConditions(): void
{
$this->assertPostConditions = true;
}

protected function tearDown(): void
{
$this->tearDown = true;
}

public function testSomething(): void
{
$this->testSomething = true;
}
}
16 changes: 8 additions & 8 deletions tests/_files/ExceptionInSetUpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,23 @@ protected function setUp(): void
throw new Exception;
}

protected function tearDown(): void
protected function assertPreConditions(): void
{
$this->tearDown = true;
$this->assertPreConditions = true;
}

public function testSomething(): void
protected function assertPostConditions(): void
{
$this->testSomething = true;
$this->assertPostConditions = true;
}

protected function assertPreConditions(): void
protected function tearDown(): void
{
$this->assertPreConditions = true;
$this->tearDown = true;
}

protected function assertPostConditions(): void
public function testSomething(): void
{
$this->assertPostConditions = true;
$this->testSomething = true;
}
}
20 changes: 10 additions & 10 deletions tests/_files/ExceptionInTearDownTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ protected function setUp(): void
$this->setUp = true;
}

protected function tearDown(): void
protected function assertPreConditions(): void
{
$this->tearDown = true;

throw new Exception('throw Exception in tearDown()');
$this->assertPreConditions = true;
}

public function testSomething(): void
protected function assertPostConditions(): void
{
$this->testSomething = true;
$this->assertPostConditions = true;
}

protected function assertPreConditions(): void
protected function tearDown(): void
{
$this->assertPreConditions = true;
$this->tearDown = true;

throw new Exception('throw Exception in tearDown()');
}

protected function assertPostConditions(): void
public function testSomething(): void
{
$this->assertPostConditions = true;
$this->testSomething = true;
}
}
20 changes: 10 additions & 10 deletions tests/_files/ExceptionInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,25 @@ protected function setUp(): void
$this->setUp = true;
}

protected function tearDown(): void
protected function assertPreConditions(): void
{
$this->tearDown = true;
$this->assertPreConditions = true;
}

public function testSomething(): void
protected function assertPostConditions(): void
{
$this->testSomething = true;

throw new Exception;
$this->assertPostConditions = true;
}

protected function assertPreConditions(): void
protected function tearDown(): void
{
$this->assertPreConditions = true;
$this->tearDown = true;
}

protected function assertPostConditions(): void
public function testSomething(): void
{
$this->assertPostConditions = true;
$this->testSomething = true;

throw new Exception;
}
}
14 changes: 7 additions & 7 deletions tests/_files/TemplateMethodsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,31 +29,31 @@ protected function setUp(): void
print __METHOD__ . "\n";
}

protected function tearDown(): void
protected function assertPreConditions(): void
{
print __METHOD__ . "\n";
}

public function testOne(): void
protected function assertPostConditions(): void
{
print __METHOD__ . "\n";
$this->assertTrue(true);
}

public function testTwo(): void
protected function tearDown(): void
{
print __METHOD__ . "\n";
$this->assertTrue(false);
}

protected function assertPreConditions(): void
public function testOne(): void
{
print __METHOD__ . "\n";
$this->assertTrue(true);
}

protected function assertPostConditions(): void
public function testTwo(): void
{
print __METHOD__ . "\n";
$this->assertTrue(false);
}

protected function onNotSuccessfulTest(Throwable $t): void
Expand Down
Binary file modified tools/composer
Binary file not shown.
Binary file modified tools/php-cs-fixer
Binary file not shown.
Binary file modified tools/psalm
Binary file not shown.

0 comments on commit 09f082e

Please sign in to comment.