From 6f2b2afaf7fa918748600b178bbdd1ca46e5c7ac Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Tue, 16 Mar 2021 14:55:39 +0000 Subject: [PATCH 1/2] Fixed failing test. --- .github/workflows/laravel.yml | 24 +++--- composer.json | 13 ++-- phpcs.xml | 65 ++++++++++++++-- phpunit.xml | 74 ++++++++----------- .../CachedBuilder/BelongsToManyTest.php | 10 ++- tools/CodeSniffer.conf | 5 ++ 6 files changed, 122 insertions(+), 69 deletions(-) create mode 100644 tools/CodeSniffer.conf diff --git a/.github/workflows/laravel.yml b/.github/workflows/laravel.yml index e2596f9..43663e4 100644 --- a/.github/workflows/laravel.yml +++ b/.github/workflows/laravel.yml @@ -10,17 +10,17 @@ jobs: laravel-tests: runs-on: ubuntu-latest - + strategy: fail-fast: true matrix: - php: [7.3, 7.4] - + php: [7.3, 7.4, 8.0] + name: PHP ${{ matrix.php }} - + steps: - uses: actions/checkout@v2 - + - name: Cache dependencies uses: actions/cache@v1 with: @@ -33,31 +33,31 @@ jobs: php-version: ${{ matrix.php }} extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, pgsql, pdo_pgsql coverage: none - + - uses: zhulik/redis-action@1.1.0 with: redis version: '5' number of databases: 100 - + - uses: harmon758/postgresql-action@v1 with: postgresql version: '11' postgresql db: 'testing' postgresql user: 'homestead' - postgresql password: 'secret' - + postgresql password: 'secret' + - name: Remove Nova on a pull request if: github.event_name == 'pull_request' run: composer remove laravel/nova --no-update --no-interaction --dev - + - name: Copy .env run: php -r "file_exists('.env') || copy('.env.example', '.env');" - + - name: Install Dependencies run: | composer config "http-basic.nova.laravel.com" "${{ secrets.NOVA_USERNAME }}" "${{ secrets.NOVA_PASSWORD }}" composer install -q --no-ansi --no-interaction --no-scripts --no-suggest --no-progress --prefer-dist - + - name: Execute Integration and Feature tests via PHPUnit run: vendor/bin/phpunit --configuration phpunit.xml.dist --testsuite Integration,Feature diff --git a/composer.json b/composer.json index 8ccb2f4..27415b7 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": ">=7.3", + "php": "^7.3|^8.0", "genealabs/laravel-pivot-events": "^8.0", "illuminate/cache": "^8.0", "illuminate/config": "^8.0", @@ -23,21 +23,22 @@ "illuminate/container": "^8.0", "illuminate/database": "^8.0", "illuminate/http": "^8.0", - "illuminate/support": "^8.0" + "illuminate/support": "^8.0", + "slevomat/coding-standard": "^6.4" }, "require-dev": { "doctrine/dbal": "^2.10", - "fzaninotto/faker": "^1.9", + "fakerphp/faker": "^1.11", "laravel/nova": "^3.9", "orchestra/testbench-browser-kit": "^6.0", "orchestra/testbench": "^6.0", "php-coveralls/php-coveralls" : "^2.2", "phpmd/phpmd": "^2.7", - "phpunit/phpunit": "^8.0", - "sebastian/phpcpd": "^5.0", + "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.4", "symfony/thanks": "^1.2", - "laravel/legacy-factories": "^1.0" + "laravel/legacy-factories": "^1.0", + "genealabs/php-coding-standards": "^0.1.4" }, "autoload": { "psr-4": { diff --git a/phpcs.xml b/phpcs.xml index 7523be9..789f708 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,11 +1,64 @@ - + GeneaLabs coding standards. - - - - - + app + bootstrap + config + database + resources + routes + storage + tests + + */*.css + */*.js + */*.xml + */cache/* + */docker/* + */public/* + */reference/* + */storage/debugbar/* + */storage/framework/* + */storage/logs/* + */tools/* + */vendor/* + bootstrap/autoload.php + bootstrap/cache/* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/phpunit.xml b/phpunit.xml index e84a484..638c186 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,44 +1,34 @@ - - - - ./tests/Feature - - - ./tests/Integration - - - ./tests/Nova - - - - - ./src - - - - - - - - - - - - - - - - - + + + + ./src + + + + + ./tests/Feature + + + ./tests/Integration + + + ./tests/Nova + + + + + + + + + + + + + + + + + diff --git a/tests/Integration/CachedBuilder/BelongsToManyTest.php b/tests/Integration/CachedBuilder/BelongsToManyTest.php index 65ec329..744d756 100644 --- a/tests/Integration/CachedBuilder/BelongsToManyTest.php +++ b/tests/Integration/CachedBuilder/BelongsToManyTest.php @@ -1,4 +1,8 @@ -disableModelCaching() @@ -17,7 +21,7 @@ public function testLazyLoadingRelationship() ->books ->first() ->id; - $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:book-store:genealabslaravelmodelcachingcachedbelongstomany-book_store.book_id_=_{$bookId}"); + $key = sha1("genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:stores:genealabslaravelmodelcachingcachedbelongstomany-book_store.book_id_=_{$bookId}"); $tags = [ "genealabs:laravel-model-caching:testing:{$this->testingSqlitePath}testing.sqlite:genealabslaravelmodelcachingtestsfixturesstore", ]; diff --git a/tools/CodeSniffer.conf b/tools/CodeSniffer.conf new file mode 100644 index 0000000..54de9e1 --- /dev/null +++ b/tools/CodeSniffer.conf @@ -0,0 +1,5 @@ + 'vendor/genealabs/php-coding-standards/src/GeneaLabs,vendor/slevomat/coding-standard/SlevomatCodingStandard', + ); +?> From 8b2b2a064fb212035b3abb84f39f20f514b794eb Mon Sep 17 00:00:00 2001 From: Mike Bronner Date: Tue, 16 Mar 2021 15:01:44 +0000 Subject: [PATCH 2/2] WIP --- composer.json | 3 +-- phpcs.xml | 65 +++++---------------------------------------------- 2 files changed, 7 insertions(+), 61 deletions(-) diff --git a/composer.json b/composer.json index 27415b7..a3c90a5 100644 --- a/composer.json +++ b/composer.json @@ -37,8 +37,7 @@ "phpunit/phpunit": "^9.0", "squizlabs/php_codesniffer": "^3.4", "symfony/thanks": "^1.2", - "laravel/legacy-factories": "^1.0", - "genealabs/php-coding-standards": "^0.1.4" + "laravel/legacy-factories": "^1.0" }, "autoload": { "psr-4": { diff --git a/phpcs.xml b/phpcs.xml index 789f708..7523be9 100644 --- a/phpcs.xml +++ b/phpcs.xml @@ -1,64 +1,11 @@ - + GeneaLabs coding standards. - app - bootstrap - config - database - resources - routes - storage - tests - - */*.css - */*.js - */*.xml - */cache/* - */docker/* - */public/* - */reference/* - */storage/debugbar/* - */storage/framework/* - */storage/logs/* - */tools/* - */vendor/* - bootstrap/autoload.php - bootstrap/cache/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + +