diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index 86b1daa..7102346 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -11,8 +11,11 @@ jobs: fail-fast: false matrix: php: [8.1, 8.2, 8.3] - laravel: [10.*] + laravel: [10.*, 11.*] dependency-version: [prefer-lowest, prefer-stable] + exclude: + - php: 8.1 + laravel: 11.* name: PHP ${{ matrix.php }} - Laravel ${{ matrix.laravel }} - ${{ matrix.dependency-version }} @@ -44,7 +47,7 @@ jobs: - name: Install dependencies run: | - composer require "illuminate/database:${{ matrix.laravel }}" "illuminate/notifications:${{ matrix.laravel }}" "illuminate/support:${{ matrix.laravel }}" --no-interaction --no-update + composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest - name: Execute tests diff --git a/.gitignore b/.gitignore index 9fc4735..f91236d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ phpunit.xml .env .phpunit.result.cache .php-cs-fixer.cache +.phpunit.cache diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index acfb07f..d6bfef7 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -1,8 +1,8 @@ true, @@ -32,7 +32,7 @@ // Converts implicit variables into explicit ones in double-quoted strings or heredoc syntax. 'explicit_string_variable' => true, // Transforms imported FQCN parameters and return types in function arguments to short version. - 'fully_qualified_strict_types' => true, + 'fully_qualified_strict_types' => false, // Add missing space between function's argument and its typehint. 'function_typehint_space' => true, // Pre- or post-increment and decrement operators should be used if possible. @@ -195,7 +195,7 @@ return (new Config()) ->registerCustomFixers([ - new ForceFQCNFixer(), + new ForceFQCNFixer() ]) ->setRules($rules) ->setFinder($finder); diff --git a/composer.json b/composer.json index 5459871..2dbe42a 100644 --- a/composer.json +++ b/composer.json @@ -29,15 +29,15 @@ ], "require": { "php": "^8.1|^8.2|^8.3", - "illuminate/database": "^7.0|^8.0|^9.0|^10.0", - "illuminate/notifications": "^7.0|^8.0|^9.0|^10.0", - "illuminate/support": "^7.0|^8.0|^9.0|^10.0" + "illuminate/database": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/notifications": "^7.0|^8.0|^9.0|^10.0|^11.0", + "illuminate/support": "^7.0|^8.0|^9.0|^10.0|^11.0" }, "require-dev": { "adamwojs/php-cs-fixer-phpdoc-force-fqcn": "^2.0", "friendsofphp/php-cs-fixer": "^3.0", - "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0", - "phpunit/phpunit": "^9.1", + "orchestra/testbench": "^5.0|^6.0|^7.0|^8.0|^9.0", + "phpunit/phpunit": "^9.1|^10.0", "squizlabs/php_codesniffer": "^3.6" }, "autoload": { diff --git a/config/verification-code.php b/config/verification-code.php index 5fb88cc..0fc5db1 100644 --- a/config/verification-code.php +++ b/config/verification-code.php @@ -59,7 +59,7 @@ | - \NextApps\VerificationCode\Notifications\VerificationCodeCreatedInterface | */ - 'notification' => \NextApps\VerificationCode\Notifications\VerificationCodeCreated::class, + 'notification' => NextApps\VerificationCode\Notifications\VerificationCodeCreated::class, /* |-------------------------------------------------------------------------- @@ -72,7 +72,7 @@ | - \NextApps\VerificationCode\Models\VerificationCode | */ - 'model' => \NextApps\VerificationCode\Models\VerificationCode::class, + 'model' => NextApps\VerificationCode\Models\VerificationCode::class, /* |-------------------------------------------------------------------------- diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 8454a4c..1a9ea9c 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,31 +1,17 @@ - + - + tests - - + + src/ - - - - - - - - + + + diff --git a/tests/Models/VerificationCodeTest.php b/tests/Models/VerificationCodeTest.php index f6ee529..2661d66 100644 --- a/tests/Models/VerificationCodeTest.php +++ b/tests/Models/VerificationCodeTest.php @@ -30,7 +30,7 @@ public function it_sets_expiration_date_based_on_config() $dbVerificationCode = VerificationCode::first(); $this->assertNotNull($dbVerificationCode->expires_at); - $this->assertEquals(0, $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6))); + $this->assertEquals(0, (int) $dbVerificationCode->expires_at->diffInMinutes(now()->addHours(6))); } /** @test */ @@ -79,7 +79,7 @@ public function it_sets_expiration_date_if_not_set_on_create() ]); $this->assertNotNull($verificationCode->expires_at); - $this->assertEquals(0, $verificationCode->expires_at->diffInMinutes(now()->addHours(4))); + $this->assertEquals(0, (int) $verificationCode->expires_at->diffInMinutes(now()->addHours(4))); } /** @test */