-
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 #68 from Yoast/develop
Release version 1.0.3
- Loading branch information
Showing
17 changed files
with
306 additions
and
34 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
name: Lint | ||
|
||
on: | ||
# Run on all pushes and on all pull requests. | ||
push: | ||
pull_request: | ||
# Allow manually triggering the workflow. | ||
workflow_dispatch: | ||
|
||
# Cancels all previous workflow runs for the same branch that have not yet completed. | ||
concurrency: | ||
# The concurrency group contains the workflow name and the branch name. | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
#### PHP Code Linting #### | ||
lint: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] | ||
|
||
name: "Lint: PHP ${{ matrix.php }}" | ||
|
||
continue-on-error: ${{ matrix.php == '8.2' }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
ini-values: zend.assertions=1, error_reporting=-1, display_errors=On | ||
coverage: none | ||
|
||
- name: 'Composer: remove PHPUnit (not needed for lint)' | ||
run: composer remove phpunit/phpunit --no-update | ||
|
||
# Install dependencies and handle caching in one go. | ||
# @link https://github.com/marketplace/actions/install-composer-dependencies | ||
- name: Install Composer dependencies | ||
uses: "ramsey/composer-install@v1" | ||
|
||
- name: "Lint PHP files against parse errors - PHP < 7.0" | ||
if: ${{ matrix.php < 7.0 }} | ||
run: composer lint-lt70 | ||
|
||
- name: "Lint PHP files against parse errors - PHP 7.x" | ||
if: ${{ startsWith( matrix.php, '7' ) }} | ||
run: composer lint7 | ||
|
||
- name: "Lint PHP files against parse errors - PHP >= 8.0" | ||
if: ${{ matrix.php >= 8.0 }} | ||
run: composer lint-gte80 |
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
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,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(); | ||
} | ||
} |
Oops, something went wrong.