From bb882546c2b655d47e3e62a6e6dc1f4e9af9198f Mon Sep 17 00:00:00 2001 From: chris cnizzardini Date: Sun, 3 Jan 2021 18:55:24 -0500 Subject: [PATCH] Fixing builds on php 8 --- .github/workflows/php.yml | 8 ++++---- src/Lib/Configuration.php | 2 +- tests/TestCase/Lib/Utility/NamespaceUtilityTest.php | 12 ------------ 3 files changed, 5 insertions(+), 17 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 87fe69ae..1474c193 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -35,12 +35,12 @@ jobs: composer validate composer install --prefer-dist --no-progress --no-suggest - - name: Test (7.3|7.4) - if: ${{ matrix.php-versions != '8.0' }} + - name: Test (7.3|8.0) + if: ${{ matrix.php-versions != '7.4' }} run: vendor/bin/phpunit - - name: Test + Coverage + Static Analysis (8.0 only) - if: ${{ matrix.php-versions == '8.0' }} + - name: Test + Coverage + Static Analysis (7.4 only) + if: ${{ matrix.php-versions == '7.4' }} env: COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | diff --git a/src/Lib/Configuration.php b/src/Lib/Configuration.php index a8f10620..af38ef80 100644 --- a/src/Lib/Configuration.php +++ b/src/Lib/Configuration.php @@ -59,7 +59,7 @@ public function __construct($config = [], $root = ROOT) 'tables' => ['\App\\'], ], ], - Configure::read('SwaggerBake') + Configure::read('SwaggerBake') ?? [] ); } diff --git a/tests/TestCase/Lib/Utility/NamespaceUtilityTest.php b/tests/TestCase/Lib/Utility/NamespaceUtilityTest.php index 418921ae..f9c3b214 100644 --- a/tests/TestCase/Lib/Utility/NamespaceUtilityTest.php +++ b/tests/TestCase/Lib/Utility/NamespaceUtilityTest.php @@ -27,12 +27,6 @@ public function testGetEntityFullyQualifiedNameSpace() $this->assertEquals('\SwaggerBakeTest\App\Model\Entity\Department', $fqns); } - public function testGetEntityFullyQualifiedNameSpaceException() - { - $this->expectException(SwaggerBakeRunTimeException::class); - NamespaceUtility::getEntityFullyQualifiedNameSpace('Department', new Configuration()); - } - public function testGetEntityFullyQualifiedNameSpaceNull() { $fqns = NamespaceUtility::getEntityFullyQualifiedNameSpace( @@ -59,12 +53,6 @@ public function testGetTableFullyQualifiedNameSpace() $this->assertEquals('\SwaggerBakeTest\App\Model\Table\DepartmentsTable', $fqns); } - public function testGetTableFullyQualifiedNameSpaceException() - { - $this->expectException(SwaggerBakeRunTimeException::class); - NamespaceUtility::getTableFullyQualifiedNameSpace('DepartmentsTable', new Configuration()); - } - public function testGetTableFullyQualifiedNameSpaceNull() { $fqns = NamespaceUtility::getTableFullyQualifiedNameSpace(