-
Notifications
You must be signed in to change notification settings - Fork 13
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 #64 from Yoast/feature/PHPUnit-10-tweak
Tests: tweaks for PHPUnit 10.x compatibility
- Loading branch information
Showing
8 changed files
with
194 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate a "failed test" to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class FailurePHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a failed test. | ||
* | ||
* @return void | ||
*/ | ||
protected function testForListener() { | ||
$this->fail(); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate an "incomplete test" to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class IncompletePHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a test marked as incomplete. | ||
* | ||
* @return void | ||
*/ | ||
protected function testForListener() { | ||
$this->markTestIncomplete( 'Test incomplete' ); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate a "risky test" to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class RiskyPHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a test marked as risky. | ||
* | ||
* @return void | ||
*/ | ||
protected function testForListener() { | ||
$this->markAsRisky(); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate a "skipped test" to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class SkippedPHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a test marked as skipped. | ||
* | ||
* @return void | ||
*/ | ||
protected function testForListener() { | ||
$this->markTestSkipped( 'Skipped test' ); | ||
} | ||
} |
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,22 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate a "successfull test" to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class SuccessPHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a successfull test. | ||
* | ||
* @return void | ||
*/ | ||
protected function testForListener() { | ||
$this->assertTrue( true ); | ||
} | ||
} |
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,27 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use Exception; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* Fixture to generate a test error to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
* | ||
* @coversNothing | ||
*/ | ||
class TestErrorPHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in an error. | ||
* | ||
* @return void | ||
* | ||
* @throws Exception For test purposes. | ||
*/ | ||
protected function testForListener() { | ||
throw new Exception(); | ||
} | ||
} |
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,25 @@ | ||
<?php | ||
|
||
namespace Yoast\PHPUnitPolyfills\Tests\TestListeners\Fixtures; | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use PHPUnit\Framework\Warning as PHPUnit_Warning; | ||
|
||
/** | ||
* Fixture to generate a test warning to pass to the test listener. | ||
* | ||
* @requires PHPUnit 7.0 | ||
*/ | ||
class WarningPHPUnitGte7 extends TestCase { | ||
|
||
/** | ||
* Test resulting in a warning. | ||
* | ||
* @return void | ||
* | ||
* @throws PHPUnit_Warning For test purposes. | ||
*/ | ||
protected function testForListener() { | ||
throw new PHPUnit_Warning(); | ||
} | ||
} |
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