From 23bb0150609dabef692411ccede44ddd6f2a138b Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Thu, 26 Nov 2026 17:21:15 +0200 Subject: [PATCH 1/2] updated codebase, composer, workflow and tests --- .github/workflows/codecov.yml | 8 ++++---- .github/workflows/static-analysis.yml | 6 +++--- composer.json | 4 ++-- test/AuthenticationInterfaceTest.php | 12 ++++++------ test/AuthenticationResultTest.php | 8 ++++---- test/Exception/InvalidArgumentExceptionTest.php | 6 +++--- test/Exception/RuntimeExceptionTest.php | 6 +++--- test/Exception/UnauthorizedExceptionTest.php | 6 +++--- test/Identity/IdentityInterfaceTest.php | 8 ++++---- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/codecov.yml b/.github/workflows/codecov.yml index c0fbc53..9652006 100644 --- a/.github/workflows/codecov.yml +++ b/.github/workflows/codecov.yml @@ -15,14 +15,14 @@ jobs: - ubuntu-latest php: - - "8.2" - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v7 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +36,7 @@ jobs: run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - name: Cache dependencies installed with composer - uses: actions/cache@v3 + uses: actions/cache@v6 with: path: ${{ env.COMPOSER_CACHE_DIR }} key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} @@ -50,6 +50,6 @@ jobs: run: vendor/bin/phpunit --colors=always --coverage-clover clover.xml - name: Send code coverage report to Codecov.io - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v7 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 9976515..2763b9c 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -15,14 +15,14 @@ jobs: - ubuntu-latest php: - - "8.2" - "8.3" - "8.4" - "8.5" + - "8.6" steps: - name: Checkout - uses: actions/checkout@v4 + uses: actions/checkout@v7 - name: Install PHP uses: shivammathur/setup-php@v2 @@ -36,7 +36,7 @@ jobs: run: echo "COMPOSER_CACHE_DIR=$(composer config cache-dir)" >> $GITHUB_ENV - name: Cache dependencies installed with composer - uses: actions/cache@v4 + uses: actions/cache@v6 with: path: ${{ env.COMPOSER_CACHE_DIR }} key: php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }} diff --git a/composer.json b/composer.json index 3eb8468..dcc8403 100644 --- a/composer.json +++ b/composer.json @@ -10,14 +10,14 @@ } ], "require": { - "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "php": "~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0", "psr/http-message": "^1.0 || ^2.0" }, "require-dev": { "laminas/laminas-coding-standard": "^3.0", "phpstan/phpstan": "^2.1", "phpstan/phpstan-phpunit": "^2.0", - "phpunit/phpunit": "^10.2" + "phpunit/phpunit": "^12.5.22" }, "autoload": { "psr-4": { diff --git a/test/AuthenticationInterfaceTest.php b/test/AuthenticationInterfaceTest.php index a4a8ba3..9dd5af9 100644 --- a/test/AuthenticationInterfaceTest.php +++ b/test/AuthenticationInterfaceTest.php @@ -7,23 +7,23 @@ use Dot\Authentication\AuthenticationInterface; use Dot\Authentication\Identity\IdentityInterface; use PHPUnit\Framework\MockObject\Exception; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class AuthenticationInterfaceTest extends TestCase { - protected AuthenticationInterface|MockObject $mockAuthenticationInterface; + protected AuthenticationInterface|Stub $mockAuthenticationInterface; - protected IdentityInterface|MockObject $identityInterfaceMock; + protected IdentityInterface|Stub $identityInterfaceMock; /** * @throws Exception */ public function setUp(): void { - $this->mockAuthenticationInterface = $this->createMock(AuthenticationInterface::class); - $this->identityInterfaceMock = $this->createMock(IdentityInterface::class); - $this->identityInterfaceMock->method('getId')->will($this->returnValue(10)); + $this->mockAuthenticationInterface = $this->createStub(AuthenticationInterface::class); + $this->identityInterfaceMock = $this->createStub(IdentityInterface::class); + $this->identityInterfaceMock->method('getId')->willReturn(10); $this->identityInterfaceMock->method('getName')->willReturn('username'); $this->mockAuthenticationInterface->method('hasIdentity')->willReturn(true); $this->mockAuthenticationInterface->method('getIdentity')->willReturn($this->identityInterfaceMock); diff --git a/test/AuthenticationResultTest.php b/test/AuthenticationResultTest.php index 0c1cfeb..76954cf 100644 --- a/test/AuthenticationResultTest.php +++ b/test/AuthenticationResultTest.php @@ -7,21 +7,21 @@ use Dot\Authentication\AuthenticationResult; use Dot\Authentication\Identity\IdentityInterface; use PHPUnit\Framework\MockObject\Exception; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class AuthenticationResultTest extends TestCase { protected AuthenticationResult $subject; - protected IdentityInterface|MockObject $identityInterfaceMock; + protected IdentityInterface|Stub $identityInterfaceMock; /** * @throws Exception */ protected function setUp(): void { - $this->identityInterfaceMock = $this->createMock(IdentityInterface::class); - $this->identityInterfaceMock->method('getId')->will($this->returnValue(10)); + $this->identityInterfaceMock = $this->createStub(IdentityInterface::class); + $this->identityInterfaceMock->method('getId')->willReturn(10); $this->identityInterfaceMock->method('getName')->willReturn('username'); $this->subject = new AuthenticationResult(2, 'valid', $this->identityInterfaceMock); } diff --git a/test/Exception/InvalidArgumentExceptionTest.php b/test/Exception/InvalidArgumentExceptionTest.php index 3976d47..f2ff224 100644 --- a/test/Exception/InvalidArgumentExceptionTest.php +++ b/test/Exception/InvalidArgumentExceptionTest.php @@ -5,16 +5,16 @@ namespace DotTest\Authentication\Exception; use InvalidArgumentException; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class InvalidArgumentExceptionTest extends TestCase { - protected InvalidArgumentException|MockObject $exceptionInterfaceMock; + protected InvalidArgumentException|Stub $exceptionInterfaceMock; public function setUp(): void { - $this->exceptionInterfaceMock = $this->createMock(InvalidArgumentException::class); + $this->exceptionInterfaceMock = $this->createStub(InvalidArgumentException::class); } public function testCreate(): void diff --git a/test/Exception/RuntimeExceptionTest.php b/test/Exception/RuntimeExceptionTest.php index c600598..c59b506 100644 --- a/test/Exception/RuntimeExceptionTest.php +++ b/test/Exception/RuntimeExceptionTest.php @@ -5,16 +5,16 @@ namespace DotTest\Authentication\Exception; use Dot\Authentication\Exception\RuntimeException; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class RuntimeExceptionTest extends TestCase { - protected RuntimeException|MockObject $exceptionInterfaceMock; + protected RuntimeException|Stub $exceptionInterfaceMock; public function setUp(): void { - $this->exceptionInterfaceMock = $this->createMock(RuntimeException::class); + $this->exceptionInterfaceMock = $this->createStub(RuntimeException::class); } public function testCreate(): void diff --git a/test/Exception/UnauthorizedExceptionTest.php b/test/Exception/UnauthorizedExceptionTest.php index 62fdfb6..a8b6258 100644 --- a/test/Exception/UnauthorizedExceptionTest.php +++ b/test/Exception/UnauthorizedExceptionTest.php @@ -5,16 +5,16 @@ namespace DotTest\Authentication\Exception; use Dot\Authentication\Exception\UnauthorizedException; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class UnauthorizedExceptionTest extends TestCase { - protected UnauthorizedException|MockObject $exceptionInterfaceMock; + protected UnauthorizedException|Stub $exceptionInterfaceMock; public function setUp(): void { - $this->exceptionInterfaceMock = $this->createMock(UnauthorizedException::class); + $this->exceptionInterfaceMock = $this->createStub(UnauthorizedException::class); } public function testCreate(): void diff --git a/test/Identity/IdentityInterfaceTest.php b/test/Identity/IdentityInterfaceTest.php index 146b4cf..20fa949 100644 --- a/test/Identity/IdentityInterfaceTest.php +++ b/test/Identity/IdentityInterfaceTest.php @@ -6,20 +6,20 @@ use Dot\Authentication\Identity\IdentityInterface; use PHPUnit\Framework\MockObject\Exception; -use PHPUnit\Framework\MockObject\MockObject; +use PHPUnit\Framework\MockObject\Stub; use PHPUnit\Framework\TestCase; class IdentityInterfaceTest extends TestCase { - protected IdentityInterface|MockObject $identityInterfaceMock; + protected IdentityInterface|Stub $identityInterfaceMock; /** * @throws Exception */ public function setUp(): void { - $this->identityInterfaceMock = $this->createMock(IdentityInterface::class); - $this->identityInterfaceMock->method('getId')->will($this->returnValue(10)); + $this->identityInterfaceMock = $this->createStub(IdentityInterface::class); + $this->identityInterfaceMock->method('getId')->willReturn(10); $this->identityInterfaceMock->method('getName')->willReturn('username'); } From f3e6086f1eb7839275dbcc2d74484b15db931626 Mon Sep 17 00:00:00 2001 From: OStefan2001 Date: Fri, 27 Nov 2026 16:19:48 +0200 Subject: [PATCH 2/2] updated overview and readme --- README.md | 4 ++-- docs/book/v2/overview.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3fd740e..ef22e9d 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ Documentation is available at: https://docs.dotkernel.org/dot-authentication/. [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/stargazers) [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/blob/2.0/LICENSE.md) -[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml) +[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml) [![codecov](https://codecov.io/gh/dotkernel/dot-authentication/graph/badge.svg?token=ZBZDEA3LY8)](https://codecov.io/gh/dotkernel/dot-authentication) -[![PHPStan](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) +[![PHPStan](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) ## Installation diff --git a/docs/book/v2/overview.md b/docs/book/v2/overview.md index cac112d..7f9c431 100644 --- a/docs/book/v2/overview.md +++ b/docs/book/v2/overview.md @@ -14,6 +14,6 @@ Core interfaces for authentication implementations. [![GitHub stars](https://img.shields.io/github/stars/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/stargazers) [![GitHub license](https://img.shields.io/github/license/dotkernel/dot-authentication)](https://github.com/dotkernel/dot-authentication/blob/2.0/LICENSE.md) -[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml) +[![Build Static](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-authentication/actions/workflows/continuous-integration.yml) [![codecov](https://codecov.io/gh/dotkernel/dot-authentication/graph/badge.svg?token=ZBZDEA3LY8)](https://codecov.io/gh/dotkernel/dot-authentication) -[![PHPStan](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.0)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml) +[![PHPStan](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml/badge.svg?branch=2.x)](https://github.com/dotkernel/dot-authentication/actions/workflows/static-analysis.yml)