diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9bfdf490..d65181fe5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,6 +1,22 @@ name: build -on: [push, pull_request] +on: + pull_request: + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' + + push: + branches: ['master'] + paths-ignore: + - 'docs/**' + - 'README.md' + - 'CHANGELOG.md' + - '.gitignore' + - '.gitattributes' env: DEFAULT_COMPOSER_FLAGS: "--prefer-dist --no-interaction --no-progress --optimize-autoloader --ansi" @@ -23,7 +39,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - php: ['5.4', '5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1', '8.2'] + php: ['7.3', '7.4', '8.1', '8.2', '8.3'] steps: - name: Checkout diff --git a/composer.json b/composer.json index 5483367b5..0b9f4f660 100644 --- a/composer.json +++ b/composer.json @@ -23,13 +23,13 @@ ], "minimum-stability": "dev", "require": { + "php": ">=7.3", "yiisoft/yii2": "~2.0.46", "phpspec/php-diff": "^1.1.0" }, "require-dev": { "yiisoft/yii2-coding-standards": "~2.0", - "cweagans/composer-patches": "^1.7", - "phpunit/phpunit": "4.8.34" + "phpunit/phpunit": "^9.6" }, "autoload": { "psr-4": { @@ -44,20 +44,6 @@ "extra": { "branch-alias": { "dev-master": "2.0.x-dev" - }, - "composer-exit-on-patch-failure": true, - "patches": { - "phpunit/phpunit-mock-objects": { - "Fix PHP 7 and 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_mock_objects.patch" - }, - "phpunit/php-file-iterator": { - "Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_path_file_iterator.patch" - }, - "phpunit/phpunit": { - "Fix PHP 7 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php7.patch", - "Fix PHP 8 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php8.patch", - "Fix PHP 8.1 compatibility": "https://yiisoft.github.io/phpunit-patches/phpunit_php81.patch" - } } }, "config": { @@ -66,7 +52,6 @@ "enabled": false }, "allow-plugins": { - "cweagans/composer-patches": true, "yiisoft/yii2-composer": true } }, diff --git a/tests/GiiTestCase.php b/tests/GiiTestCase.php index f390ee6ea..e5138186e 100644 --- a/tests/GiiTestCase.php +++ b/tests/GiiTestCase.php @@ -13,7 +13,7 @@ class GiiTestCase extends TestCase { protected $driverName = 'sqlite'; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -49,4 +49,4 @@ protected function setUp() } } } -} \ No newline at end of file +} diff --git a/tests/TestCase.php b/tests/TestCase.php index e6d111520..fda7843de 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -15,7 +15,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase * Clean up after test. * By default the application created with [[mockApplication]] will be destroyed. */ - protected function tearDown() + protected function tearDown(): void { parent::tearDown(); $this->destroyApplication(); diff --git a/tests/bootstrap.php b/tests/bootstrap.php index a9b8059a4..a9dd30f9c 100644 --- a/tests/bootstrap.php +++ b/tests/bootstrap.php @@ -13,5 +13,3 @@ Yii::setAlias('@yiiunit/gii', __DIR__); Yii::setAlias('@yii/gii', dirname(__DIR__) . '/src'); - -require_once(__DIR__ . '/compatibility.php'); \ No newline at end of file diff --git a/tests/compatibility.php b/tests/compatibility.php deleted file mode 100644 index d27c0ef1c..000000000 --- a/tests/compatibility.php +++ /dev/null @@ -1,37 +0,0 @@ -setExpectedException($exception); - } - - /** - * @param string $message - */ - public function expectExceptionMessage($message) - { - $this->setExpectedException($this->getExpectedException(), $message); - } - } - } -}