Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- ubuntu-latest

php:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
checks: write
strategy:
matrix:
php-versions: [ '8.2', '8.3', '8.4', '8.5' ]
php-versions: ['8.3', '8.4', '8.5' ]
steps:
- uses: actions/checkout@v6
with:
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
- ubuntu-latest

php:
- "8.2"
- "8.3"
- "8.4"
- "8.5"
Expand Down
23 changes: 23 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# Changelog

## 7.2.0 - 2026-04-21

### Changed

* Issue [#419](https://github.com/dotkernel/admin/issues/419): Bump `PHPUnit` to version `12.5.23` by [@SergiuBota1](https://github.com/SergiuBota1) in [#420](https://github.com/dotkernel/admin/pull/420)

### Added

* Nothing

### Deprecated

* Nothing

### Removed

* Removed PHP `8.2` support

### Fixed

* Fixed PHPUnit notices caused by mock objects without expectations configured
* Fixed PHPUnit deprecation warnings caused by using `with()` on test stubs

## 7.1.0 - 2026-03-27

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Documentation is available at: https://docs.dotkernel.org/admin-documentation/

| Branch | Release | PSR-11 | OSS Lifecycle | PHP Version |
|--------|----------|--------|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| 7.0 | `>= 7.0` | 1 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F7.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/7.1.0) |
| 7.0 | `>= 7.0` | 1 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F7.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/7.2.0) |
| 6.0 | `< 7.0` | 1 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F6.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/6.2.0) |
| 5.0 | `< 6.0` | 1 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F5.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/5.0.3) |
| 4.0 | `< 5.0` | 1 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F4.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.3.1) |
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

| Branch | OSS Lifecycle | PHP Version |
|--------|----------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|
| 7.0 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F7.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/7.1.0) |
| 7.0 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F7.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/7.2.0) |
| 6.0 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F6.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/6.2.0) |
| 5.0 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F5.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/5.0.3) |
| 4.0 | ![OSS Lifecycle](https://img.shields.io/osslifecycle?file_url=https%3A%2F%2Fgithub.com%2Fdotkernel%2Fadmin%2Fblob%2F4.0%2FOSSMETADATA) | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/admin/4.3.1) |
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"process-timeout": 0
},
"require": {
"php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0",
"php": "~8.3.0 || ~8.4.0 || ~8.5.0",
"dotkernel/dot-cache": "^4.4.0",
"dotkernel/dot-cli": "^3.10.0",
"dotkernel/dot-data-fixtures": "^1.5.0",
Expand Down Expand Up @@ -64,7 +64,7 @@
"phpstan/phpstan": "^2.1.32",
"phpstan/phpstan-doctrine": "^2.0.11",
"phpstan/phpstan-phpunit": "^2.0.8",
"phpunit/phpunit": "^10.5.58",
"phpunit/phpunit": "^12.5.23",
"roave/security-advisories": "dev-latest",
"symfony/var-dumper": "^7.4.0",
"vincentlanglet/twig-cs-fixer": "^3.11.0"
Expand Down
3 changes: 3 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
displayDetailsOnPhpunitNotices="true"
displayDetailsOnTestsThatTriggerDeprecations="true"
displayDetailsOnPhpunitDeprecations="true"
stopOnError="true">
<testsuites>
<testsuite name="UnitTests">
Expand Down
14 changes: 7 additions & 7 deletions test/Unit/Admin/Adapter/AuthenticationAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class AuthenticationAdapterTest extends UnitTest
public function testAccessors(): void
{
$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[]
);

Expand All @@ -54,14 +54,14 @@ public function testAccessors(): void
public function testWillNotAuthenticateWithoutValidConfig(): void
{
$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[]
);
$this->expectExceptionMessage('No or invalid param "identity_class" provided.');
$adapter->authenticate();

$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[
'orm_default' => [
'identity_class' => Admin::class,
Expand All @@ -72,7 +72,7 @@ public function testWillNotAuthenticateWithoutValidConfig(): void
$adapter->authenticate();

$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[
'orm_default' => [
'identity_class' => Admin::class,
Expand All @@ -84,7 +84,7 @@ public function testWillNotAuthenticateWithoutValidConfig(): void
$adapter->authenticate();

$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[
'orm_default' => [
'identity_class' => Admin::class,
Expand All @@ -104,7 +104,7 @@ public function testWillNotAuthenticateWithoutValidConfig(): void
public function testWillNotAuthenticateWithInvalidIdentityClassConfig(): void
{
$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[
'orm_default' => [
'identity_class' => Exception::class,
Expand Down Expand Up @@ -133,7 +133,7 @@ public function testWillNotAuthenticateWithInvalidIdentityClassConfig(): void
public function testWillNotAuthenticateWithInvalidIdentityPropertyConfig(): void
{
$adapter = new AuthenticationAdapter(
$this->createMock(EntityManager::class),
$this->createStub(EntityManager::class),
[
'orm_default' => [
'identity_class' => Admin::class,
Expand Down
4 changes: 2 additions & 2 deletions test/Unit/Admin/Delegator/AdminRoleDelegatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class AdminRoleDelegatorTest extends UnitTest
*/
public function testInvokeWillSucceedWithoutAdminForm(): void
{
$container = $this->createMock(ContainerInterface::class);
$container = $this->createStub(ContainerInterface::class);

$delegator = (new AdminRoleDelegator())(
$container,
Expand All @@ -47,7 +47,7 @@ public function testInvokeWillSucceedWithAdminForm(): void
->method('get')
->with(EntityManagerInterface::class)
->willReturn(
$this->createMock(EntityManagerInterface::class)
$this->createStub(EntityManagerInterface::class)
);

$delegator = (new AdminRoleDelegator())(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AuthenticationServiceFactoryTest extends UnitTest
*/
public function testWillInvoke(): void
{
$authenticationAdapter = $this->createMock(AuthenticationAdapter::class);
$authenticationAdapter = $this->createStub(AuthenticationAdapter::class);

$container = $this->createMock(ContainerInterface::class);
$container->expects($this->once())
Expand Down
22 changes: 11 additions & 11 deletions test/Unit/Admin/Handler/Account/GetAccountEditFormHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ class GetAccountEditFormHandlerTest extends UnitTest
*/
public function testWillReturnHtmlTemplate(): void
{
$adminService = $this->createMock(AdminServiceInterface::class);
$router = $this->createMock(RouterInterface::class);
$template = $this->createMock(TemplateRendererInterface::class);
$authenticationService = $this->createMock(AuthenticationServiceInterface::class);
$accountForm = $this->createMock(AccountForm::class);
$changePasswordForm = $this->createMock(ChangePasswordForm::class);
$messenger = $this->createMock(FlashMessengerInterface::class);
$request = $this->createMock(ServerRequestInterface::class);
$identity = $this->createMock(AdminIdentity::class);
$adminRepository = $this->createMock(AdminRepository::class);
$admin = $this->createMock(Admin::class);
$adminService = $this->createStub(AdminServiceInterface::class);
$router = $this->createStub(RouterInterface::class);
$template = $this->createStub(TemplateRendererInterface::class);
$authenticationService = $this->createStub(AuthenticationServiceInterface::class);
$accountForm = $this->createStub(AccountForm::class);
$changePasswordForm = $this->createStub(ChangePasswordForm::class);
$messenger = $this->createStub(FlashMessengerInterface::class);
$request = $this->createStub(ServerRequestInterface::class);
$identity = $this->createStub(AdminIdentity::class);
$adminRepository = $this->createStub(AdminRepository::class);
$admin = $this->createStub(Admin::class);

$identity->method('getId')->willReturn('test');
$authenticationService->method('getIdentity')->willReturn($identity);
Expand Down
28 changes: 14 additions & 14 deletions test/Unit/Admin/Handler/Account/GetAccountLoginFormHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ class GetAccountLoginFormHandlerTest extends UnitTest
*/
public function testAdminLoggedWillReturnRedirectResponse(): void
{
$router = $this->createMock(RouterInterface::class);
$template = $this->createMock(TemplateRendererInterface::class);
$authenticationService = $this->createMock(AuthenticationServiceInterface::class);
$messenger = $this->createMock(FlashMessengerInterface::class);
$formsPlugin = $this->createMock(FormsPlugin::class);
$loginForm = $this->createMock(LoginForm::class);
$request = $this->createMock(ServerRequestInterface::class);
$router = $this->createStub(RouterInterface::class);
$template = $this->createStub(TemplateRendererInterface::class);
$authenticationService = $this->createStub(AuthenticationServiceInterface::class);
$messenger = $this->createStub(FlashMessengerInterface::class);
$formsPlugin = $this->createStub(FormsPlugin::class);
$loginForm = $this->createStub(LoginForm::class);
$request = $this->createStub(ServerRequestInterface::class);

$authenticationService->method('hasIdentity')->willReturn(true);

Expand All @@ -52,13 +52,13 @@ public function testAdminLoggedWillReturnRedirectResponse(): void
*/
public function testWillReturnHtmlResponse(): void
{
$router = $this->createMock(RouterInterface::class);
$template = $this->createMock(TemplateRendererInterface::class);
$authenticationService = $this->createMock(AuthenticationServiceInterface::class);
$messenger = $this->createMock(FlashMessengerInterface::class);
$formsPlugin = $this->createMock(FormsPlugin::class);
$loginForm = $this->createMock(LoginForm::class);
$request = $this->createMock(ServerRequestInterface::class);
$router = $this->createStub(RouterInterface::class);
$template = $this->createStub(TemplateRendererInterface::class);
$authenticationService = $this->createStub(AuthenticationServiceInterface::class);
$messenger = $this->createStub(FlashMessengerInterface::class);
$formsPlugin = $this->createStub(FormsPlugin::class);
$loginForm = $this->createStub(LoginForm::class);
$request = $this->createStub(ServerRequestInterface::class);

$authenticationService->method('hasIdentity')->willReturn(false);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ class GetAccountLogoutHandlerTest extends UnitTest
*/
public function testLogoutWillReturnRedirectResponse(): void
{
$router = $this->createMock(RouterInterface::class);
$authenticationService = $this->createMock(AuthenticationServiceInterface::class);
$request = $this->createMock(ServerRequestInterface::class);
$router = $this->createStub(RouterInterface::class);
$authenticationService = $this->createStub(AuthenticationServiceInterface::class);
$request = $this->createStub(ServerRequestInterface::class);

$handler = new GetLogoutAccountHandler(
$router,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,21 @@
use Mezzio\Template\TemplateRendererInterface;
use PHPUnit\Framework\MockObject\Exception as MockObjectException;
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\MockObject\Stub;
use Psr\Http\Message\ServerRequestInterface;

class PostAccountChangePasswordHandlerTest extends UnitTest
{
private MockObject&AdminServiceInterface $adminService;
private MockObject&RouterInterface $router;
private MockObject&TemplateRendererInterface $template;
private MockObject&AuthenticationServiceInterface $authenticationService;
private Stub&AdminServiceInterface $adminService;
private Stub&RouterInterface $router;
private Stub&TemplateRendererInterface $template;
private Stub&AuthenticationServiceInterface $authenticationService;
private MockObject&FlashMessengerInterface $messenger;
private MockObject&AccountForm $accountForm;
private MockObject&ChangePasswordForm $changePasswordForm;
private MockObject&ServerRequestInterface $request;
private MockObject&AdminIdentity $identity;
private MockObject&Admin $admin;
private Stub&AccountForm $accountForm;
private Stub&ChangePasswordForm $changePasswordForm;
private Stub&ServerRequestInterface $request;
private Stub&AdminIdentity $identity;
private Stub&Admin $admin;
private Logger $logger;

/**
Expand All @@ -44,16 +45,16 @@ public function setUp(): void
{
parent::setUp();

$this->adminService = $this->createMock(AdminServiceInterface::class);
$this->router = $this->createMock(RouterInterface::class);
$this->template = $this->createMock(TemplateRendererInterface::class);
$this->authenticationService = $this->createMock(AuthenticationServiceInterface::class);
$this->adminService = $this->createStub(AdminServiceInterface::class);
$this->router = $this->createStub(RouterInterface::class);
$this->template = $this->createStub(TemplateRendererInterface::class);
$this->authenticationService = $this->createStub(AuthenticationServiceInterface::class);
$this->messenger = $this->createMock(FlashMessengerInterface::class);
$this->accountForm = $this->createMock(AccountForm::class);
$this->changePasswordForm = $this->createMock(ChangePasswordForm::class);
$this->request = $this->createMock(ServerRequestInterface::class);
$this->identity = $this->createMock(AdminIdentity::class);
$this->admin = $this->createMock(Admin::class);
$this->accountForm = $this->createStub(AccountForm::class);
$this->changePasswordForm = $this->createStub(ChangePasswordForm::class);
$this->request = $this->createStub(ServerRequestInterface::class);
$this->identity = $this->createStub(AdminIdentity::class);
$this->admin = $this->createStub(Admin::class);
$this->logger = new Logger([
'writers' => [
'FileWriter' => [
Expand All @@ -75,6 +76,7 @@ public function testInvalidChangePasswordFormDataProvidedWillReturnHtmlResponse(
$this->changePasswordForm->method('isValid')->willReturn(false);
$this->accountForm->method('prepare')->willReturn('<form></form>');
$this->changePasswordForm->method('prepare')->willReturn('<form></form>');
$this->messenger->expects($this->never())->method('addError');

$handler = new PostChangeAccountPasswordHandler(
$this->adminService,
Expand Down
Loading
Loading