From 1405da10188369da999ec9bf1bdcc95a640686ba Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 30 Nov 2023 15:25:23 -0500 Subject: [PATCH 1/3] Preparing for 1.0 release and PHPUnit 10 --- .phpunit.cache/test-results | 1 + composer.json | 17 +++++++++++------ phpunit.xml | 18 +++++++++--------- ...e-application.php => CreateApplication.php} | 2 +- tests/{class-test-case.php => TestCase.php} | 4 ++-- .../{test-example.php => ExampleTest.php} | 4 ++-- 6 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 .phpunit.cache/test-results rename tests/{trait-create-application.php => CreateApplication.php} (96%) rename tests/{class-test-case.php => TestCase.php} (61%) rename tests/feature/{test-example.php => ExampleTest.php} (81%) diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..ca21285 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"App\\Tests\\Feature\\ExampleTest::test_example":0.001,"App\\Tests\\Feature\\ExampleTest::test_route":0.029}} \ No newline at end of file diff --git a/composer.json b/composer.json index 18c316e..40b30ab 100644 --- a/composer.json +++ b/composer.json @@ -1,8 +1,8 @@ { "name": "alleyinteractive/mantle", - "type": "project", "description": "A site using the Mantle framework for WordPress", "license": "GPL-2.0-or-later", + "type": "project", "authors": [ { "name": "Alley", @@ -11,16 +11,23 @@ ], "require": { "alleyinteractive/composer-wordpress-autoloader": "^1.0", - "alleyinteractive/mantle-framework": "^0.12", + "alleyinteractive/mantle-framework": "^1.0", "fakerphp/faker": "^1.23" }, "require-dev": { "alleyinteractive/alley-coding-standards": "^2.0", - "nunomaduro/collision": "^6.4", + "nunomaduro/collision": "^7.0", "phpstan/phpstan": "1.10.15", - "phpunit/phpunit": "^9.6.10", + "phpunit/phpunit": "^9.3.3 || ^10.4.2", "szepeviktor/phpstan-wordpress": "^1.3" }, + "minimum-stability": "dev", + "prefer-stable": true, + "autoload-dev": { + "psr-4": { + "App\\Tests\\": "tests/" + } + }, "config": { "allow-plugins": { "alleyinteractive/composer-wordpress-autoloader": true, @@ -41,8 +48,6 @@ } } }, - "minimum-stability": "dev", - "prefer-stable": true, "scripts": { "post-autoload-dump": [ "bin/mantle package:discover", diff --git a/phpunit.xml b/phpunit.xml index 0595632..9309ea6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,15 +1,15 @@ + - - - tests - - + + + tests + + diff --git a/tests/trait-create-application.php b/tests/CreateApplication.php similarity index 96% rename from tests/trait-create-application.php rename to tests/CreateApplication.php index 1aaf388..e4f6de6 100644 --- a/tests/trait-create-application.php +++ b/tests/CreateApplication.php @@ -13,7 +13,7 @@ /** * Concern for creating the application instance. */ -trait Create_Application { +trait CreateApplication { /** * Creates the application from the application instance. * diff --git a/tests/class-test-case.php b/tests/TestCase.php similarity index 61% rename from tests/class-test-case.php rename to tests/TestCase.php index 704b2b5..5479e08 100644 --- a/tests/class-test-case.php +++ b/tests/TestCase.php @@ -10,6 +10,6 @@ /** * Base Test Case that each Test Case should extend. */ -abstract class Test_Case extends \Mantle\Testing\Test_Case { - use Create_Application; +abstract class TestCase extends \Mantle\Testing\Test_Case { + use CreateApplication; } diff --git a/tests/feature/test-example.php b/tests/feature/ExampleTest.php similarity index 81% rename from tests/feature/test-example.php rename to tests/feature/ExampleTest.php index 354171a..900113f 100644 --- a/tests/feature/test-example.php +++ b/tests/feature/ExampleTest.php @@ -7,12 +7,12 @@ namespace App\Tests\Feature; -use App\Tests\Test_Case; +use App\Tests\TestCase; /** * Base Test Case that each Test Case should extend. */ -class Test_Example extends Test_Case { +class ExampleTest extends TestCase { public function test_example() { $this->assertTrue( true ); } From ead09a71e2230d16d83915da8723d1034b78788f Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 30 Nov 2023 15:28:02 -0500 Subject: [PATCH 2/3] Adjust CI workflows --- .github/workflows/coding-standards.yml | 1 + .github/workflows/node-tests.yml | 1 + .github/workflows/tests.yml | 3 ++- 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index ab52834..573b664 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - '*.x' - '*.*.x' pull_request: schedule: diff --git a/.github/workflows/node-tests.yml b/.github/workflows/node-tests.yml index d693654..0dcee38 100644 --- a/.github/workflows/node-tests.yml +++ b/.github/workflows/node-tests.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - '*.x' - '*.*.x' pull_request: diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 0ebbce8..0d2829b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -4,6 +4,7 @@ on: push: branches: - main + - '*.x' - '*.*.x' pull_request: schedule: @@ -13,7 +14,7 @@ jobs: php-tests: strategy: matrix: - php: [8.0, 8.1, 8.2] + php: [8.1, 8.2] wordpress: ["latest"] multisite: [true, false] uses: alleyinteractive/.github/.github/workflows/php-tests.yml@main From eff5e62746aec7d3dca283e91b6b3a71625ac112 Mon Sep 17 00:00:00 2001 From: Sean Fisher Date: Thu, 30 Nov 2023 15:29:28 -0500 Subject: [PATCH 3/3] Ignoring .phpunit.cache/test-results --- .gitignore | 1 + .phpunit.cache/test-results | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 .phpunit.cache/test-results diff --git a/.gitignore b/.gitignore index db2f956..d2014ca 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ vendor composer.lock bootstrap/cache .phpunit.result.cache +.phpunit.cache/* .phpcs/*.json # Ignore temporary OS files diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results deleted file mode 100644 index ca21285..0000000 --- a/.phpunit.cache/test-results +++ /dev/null @@ -1 +0,0 @@ -{"version":1,"defects":[],"times":{"App\\Tests\\Feature\\ExampleTest::test_example":0.001,"App\\Tests\\Feature\\ExampleTest::test_route":0.029}} \ No newline at end of file