From daccc3b11a4825e6755e5899458c788399e1e2e5 Mon Sep 17 00:00:00 2001 From: prolic Date: Wed, 5 Feb 2025 21:59:24 -0300 Subject: [PATCH 1/2] update copyright --- LICENSE | 4 ++-- src/Event/ActionEvent.php | 4 ++-- src/Event/ActionEventEmitter.php | 4 ++-- src/Event/ActionEventListenerAggregate.php | 4 ++-- src/Event/DefaultActionEvent.php | 4 ++-- src/Event/DefaultListenerHandler.php | 4 ++-- src/Event/DetachAggregateHandlers.php | 4 ++-- src/Event/ListenerHandler.php | 4 ++-- src/Event/ProophActionEventEmitter.php | 4 ++-- src/Messaging/Command.php | 4 ++-- src/Messaging/DomainEvent.php | 4 ++-- src/Messaging/DomainMessage.php | 4 ++-- src/Messaging/FQCNMessageFactory.php | 4 ++-- src/Messaging/HasMessageName.php | 4 ++-- src/Messaging/Message.php | 4 ++-- src/Messaging/MessageConverter.php | 4 ++-- src/Messaging/MessageDataAssertion.php | 4 ++-- src/Messaging/MessageFactory.php | 4 ++-- src/Messaging/NoOpMessageConverter.php | 4 ++-- src/Messaging/PayloadConstructable.php | 4 ++-- src/Messaging/PayloadTrait.php | 4 ++-- src/Messaging/Query.php | 4 ++-- tests/Event/DefaultActionEventTest.php | 4 ++-- tests/Event/ProophActionEventEmitterTest.php | 4 ++-- tests/Messaging/CommandTest.php | 4 ++-- tests/Messaging/DomainEventTest.php | 4 ++-- tests/Messaging/FQCNMessageFactoryTest.php | 4 ++-- tests/Messaging/MessageDataAssertionTest.php | 4 ++-- tests/Messaging/NoOpMessageConverterTest.php | 4 ++-- tests/Messaging/QueryTest.php | 4 ++-- tests/Mock/ActionEventListenerMock.php | 4 ++-- tests/Mock/ActionListenerAggregateMock.php | 4 ++-- tests/Mock/AskSomething.php | 4 ++-- tests/Mock/DoSomething.php | 4 ++-- tests/Mock/InvalidMessage.php | 4 ++-- tests/Mock/SomethingWasDone.php | 4 ++-- 36 files changed, 72 insertions(+), 72 deletions(-) diff --git a/LICENSE b/LICENSE index 788f178..8ecf3b4 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,5 @@ -Copyright (c) 2014-2020, Alexander Miertsch -Copyright (c) 2015-2020, Sascha-Oliver Prolic +Copyright (c) 2014-2025, Alexander Miertsch +Copyright (c) 2015-2025, Sascha-Oliver Prolic All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/src/Event/ActionEvent.php b/src/Event/ActionEvent.php index 061ed00..fede04e 100644 --- a/src/Event/ActionEvent.php +++ b/src/Event/ActionEvent.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/ActionEventEmitter.php b/src/Event/ActionEventEmitter.php index 50bfff6..14ebc24 100644 --- a/src/Event/ActionEventEmitter.php +++ b/src/Event/ActionEventEmitter.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/ActionEventListenerAggregate.php b/src/Event/ActionEventListenerAggregate.php index 8c14ef7..977f5e2 100644 --- a/src/Event/ActionEventListenerAggregate.php +++ b/src/Event/ActionEventListenerAggregate.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/DefaultActionEvent.php b/src/Event/DefaultActionEvent.php index 9d50c53..d868438 100644 --- a/src/Event/DefaultActionEvent.php +++ b/src/Event/DefaultActionEvent.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/DefaultListenerHandler.php b/src/Event/DefaultListenerHandler.php index 540a4f7..0493174 100644 --- a/src/Event/DefaultListenerHandler.php +++ b/src/Event/DefaultListenerHandler.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/DetachAggregateHandlers.php b/src/Event/DetachAggregateHandlers.php index 3591e83..cee952f 100644 --- a/src/Event/DetachAggregateHandlers.php +++ b/src/Event/DetachAggregateHandlers.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/ListenerHandler.php b/src/Event/ListenerHandler.php index 97db08d..4cf6e29 100644 --- a/src/Event/ListenerHandler.php +++ b/src/Event/ListenerHandler.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Event/ProophActionEventEmitter.php b/src/Event/ProophActionEventEmitter.php index 0e0bd4f..2f5add9 100644 --- a/src/Event/ProophActionEventEmitter.php +++ b/src/Event/ProophActionEventEmitter.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/Command.php b/src/Messaging/Command.php index e2d8449..41426a2 100644 --- a/src/Messaging/Command.php +++ b/src/Messaging/Command.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/DomainEvent.php b/src/Messaging/DomainEvent.php index c5fc546..66214a3 100644 --- a/src/Messaging/DomainEvent.php +++ b/src/Messaging/DomainEvent.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/DomainMessage.php b/src/Messaging/DomainMessage.php index 1972f6b..f5668f0 100644 --- a/src/Messaging/DomainMessage.php +++ b/src/Messaging/DomainMessage.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/FQCNMessageFactory.php b/src/Messaging/FQCNMessageFactory.php index 46875fa..8959141 100644 --- a/src/Messaging/FQCNMessageFactory.php +++ b/src/Messaging/FQCNMessageFactory.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/HasMessageName.php b/src/Messaging/HasMessageName.php index 48855d8..aa59b0b 100644 --- a/src/Messaging/HasMessageName.php +++ b/src/Messaging/HasMessageName.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/Message.php b/src/Messaging/Message.php index d1de45a..ed6d25b 100644 --- a/src/Messaging/Message.php +++ b/src/Messaging/Message.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/MessageConverter.php b/src/Messaging/MessageConverter.php index 8d89736..08159b9 100644 --- a/src/Messaging/MessageConverter.php +++ b/src/Messaging/MessageConverter.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/MessageDataAssertion.php b/src/Messaging/MessageDataAssertion.php index d9a7dc2..c5492d0 100644 --- a/src/Messaging/MessageDataAssertion.php +++ b/src/Messaging/MessageDataAssertion.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/MessageFactory.php b/src/Messaging/MessageFactory.php index dd04da6..855a596 100644 --- a/src/Messaging/MessageFactory.php +++ b/src/Messaging/MessageFactory.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/NoOpMessageConverter.php b/src/Messaging/NoOpMessageConverter.php index aad8cf8..0b74e10 100644 --- a/src/Messaging/NoOpMessageConverter.php +++ b/src/Messaging/NoOpMessageConverter.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/PayloadConstructable.php b/src/Messaging/PayloadConstructable.php index bcd10c1..a7f9144 100644 --- a/src/Messaging/PayloadConstructable.php +++ b/src/Messaging/PayloadConstructable.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/PayloadTrait.php b/src/Messaging/PayloadTrait.php index 498e7c6..fb7ec03 100644 --- a/src/Messaging/PayloadTrait.php +++ b/src/Messaging/PayloadTrait.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/src/Messaging/Query.php b/src/Messaging/Query.php index 93a218a..4847025 100644 --- a/src/Messaging/Query.php +++ b/src/Messaging/Query.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Event/DefaultActionEventTest.php b/tests/Event/DefaultActionEventTest.php index 47f3ca9..b89475f 100644 --- a/tests/Event/DefaultActionEventTest.php +++ b/tests/Event/DefaultActionEventTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Event/ProophActionEventEmitterTest.php b/tests/Event/ProophActionEventEmitterTest.php index e13b697..3b95331 100644 --- a/tests/Event/ProophActionEventEmitterTest.php +++ b/tests/Event/ProophActionEventEmitterTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/CommandTest.php b/tests/Messaging/CommandTest.php index 53dae36..1d2556f 100644 --- a/tests/Messaging/CommandTest.php +++ b/tests/Messaging/CommandTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/DomainEventTest.php b/tests/Messaging/DomainEventTest.php index 09b2910..a1cfbb5 100644 --- a/tests/Messaging/DomainEventTest.php +++ b/tests/Messaging/DomainEventTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/FQCNMessageFactoryTest.php b/tests/Messaging/FQCNMessageFactoryTest.php index 4f89229..f0e55e3 100644 --- a/tests/Messaging/FQCNMessageFactoryTest.php +++ b/tests/Messaging/FQCNMessageFactoryTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/MessageDataAssertionTest.php b/tests/Messaging/MessageDataAssertionTest.php index d4a1f80..a927aa0 100644 --- a/tests/Messaging/MessageDataAssertionTest.php +++ b/tests/Messaging/MessageDataAssertionTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/NoOpMessageConverterTest.php b/tests/Messaging/NoOpMessageConverterTest.php index 9f5b424..936e013 100644 --- a/tests/Messaging/NoOpMessageConverterTest.php +++ b/tests/Messaging/NoOpMessageConverterTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Messaging/QueryTest.php b/tests/Messaging/QueryTest.php index 76e87e8..2e70d95 100644 --- a/tests/Messaging/QueryTest.php +++ b/tests/Messaging/QueryTest.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/ActionEventListenerMock.php b/tests/Mock/ActionEventListenerMock.php index 9dc12cc..b10e7d4 100644 --- a/tests/Mock/ActionEventListenerMock.php +++ b/tests/Mock/ActionEventListenerMock.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/ActionListenerAggregateMock.php b/tests/Mock/ActionListenerAggregateMock.php index e84c73d..b0c5336 100644 --- a/tests/Mock/ActionListenerAggregateMock.php +++ b/tests/Mock/ActionListenerAggregateMock.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/AskSomething.php b/tests/Mock/AskSomething.php index 18dc263..7e1f47c 100644 --- a/tests/Mock/AskSomething.php +++ b/tests/Mock/AskSomething.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/DoSomething.php b/tests/Mock/DoSomething.php index 5f3c82a..2fcda07 100644 --- a/tests/Mock/DoSomething.php +++ b/tests/Mock/DoSomething.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/InvalidMessage.php b/tests/Mock/InvalidMessage.php index cf853ad..38424f7 100644 --- a/tests/Mock/InvalidMessage.php +++ b/tests/Mock/InvalidMessage.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. diff --git a/tests/Mock/SomethingWasDone.php b/tests/Mock/SomethingWasDone.php index 69f6e62..f370337 100644 --- a/tests/Mock/SomethingWasDone.php +++ b/tests/Mock/SomethingWasDone.php @@ -2,8 +2,8 @@ /** * This file is part of prooph/common. - * (c) 2014-2022 Alexander Miertsch - * (c) 2015-2022 Sascha-Oliver Prolic + * (c) 2014-2025 Alexander Miertsch + * (c) 2015-2025 Sascha-Oliver Prolic * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. From dd1683fddcef7433b8a4eb09cab35fb833c8ceae Mon Sep 17 00:00:00 2001 From: Bas Kamer Date: Sun, 16 Feb 2025 00:06:35 +0100 Subject: [PATCH 2/2] minor test improvements (#86) * wrong (empty) directive * static data provider * fix test warn * bumped php & phpunit * migrated phpunit conf * ignore phpunit cache dir * migrate to attributes * refactor around deprecated getMockForAbstractClass * cs --- .gitignore | 1 + composer.json | 4 +- phpunit.xml.dist | 19 +++--- tests/Event/DefaultActionEventTest.php | 45 ++++---------- tests/Event/ProophActionEventEmitterTest.php | 63 +++++++------------- tests/Messaging/CommandTest.php | 41 ++++--------- tests/Messaging/DomainEventTest.php | 29 +++------ tests/Messaging/FQCNMessageFactoryTest.php | 17 ++---- tests/Messaging/MessageDataAssertionTest.php | 15 ++--- tests/Messaging/NoOpMessageConverterTest.php | 21 ++++--- tests/Messaging/QueryTest.php | 5 +- 11 files changed, 91 insertions(+), 169 deletions(-) diff --git a/.gitignore b/.gitignore index f454591..6aee044 100644 --- a/.gitignore +++ b/.gitignore @@ -8,4 +8,5 @@ nbproject composer.lock .phpunit.result.cache +.phpunit.cache .phpcs-cache diff --git a/composer.json b/composer.json index 1ee2d7b..e04ff3b 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,13 @@ "minimum-stability": "dev", "prefer-stable": true, "require": { - "php": "^7.4 || ^8.0", + "php": "^8.2", "ramsey/uuid": "4.1.2 || ^4.3", "beberlei/assert": "^2.7.1 || ^3.0" }, "require-dev": { "php-coveralls/php-coveralls": "^2.2", - "phpunit/phpunit": "^9.5.5", + "phpunit/phpunit": "^11.0", "prooph/bookdown-template": "^0.2.3", "prooph/php-cs-fixer-config": "^0.5" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d7438b6..76f01ec 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,11 @@ - - - - ./src - - - - - ./tests/ - + + + ./tests/ + + + + ./src + + diff --git a/tests/Event/DefaultActionEventTest.php b/tests/Event/DefaultActionEventTest.php index b89475f..ed5ac64 100644 --- a/tests/Event/DefaultActionEventTest.php +++ b/tests/Event/DefaultActionEventTest.php @@ -13,6 +13,7 @@ namespace ProophTest\Common\Event; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Event\DefaultActionEvent; @@ -26,9 +27,7 @@ private function getTestEvent() return new DefaultActionEvent('test-event', 'target', ['param1' => 'foo']); } - /** - * @test - */ + #[Test] public function it_can_be_initialized_with_a_name_a_target_and_params(): void { $event = $this->getTestEvent(); @@ -38,9 +37,7 @@ public function it_can_be_initialized_with_a_name_a_target_and_params(): void $this->assertEquals(['param1' => 'foo'], $event->getParams()); } - /** - * @test - */ + #[Test] public function it_can_initialized_without_a_target_and_params(): void { $event = new DefaultActionEvent('test-event'); @@ -49,9 +46,7 @@ public function it_can_initialized_without_a_target_and_params(): void $this->assertEquals([], $event->getParams()); } - /** - * @test - */ + #[Test] public function it_returns_param_if_set(): void { $event = $this->getTestEvent(); @@ -60,25 +55,19 @@ public function it_returns_param_if_set(): void $this->assertEquals('bar', $event->getParam('param1')); } - /** - * @test - */ + #[Test] public function it_returns_null_if_param_is_not_set_and_no_other_default_is_given(): void { $this->assertNull($this->getTestEvent()->getParam('unknown')); } - /** - * @test - */ + #[Test] public function it_returns_default_if_param_is_not_set(): void { $this->assertEquals('default', $this->getTestEvent()->getParam('unknown', 'default')); } - /** - * @test - */ + #[Test] public function it_changes_name_when_new_one_is_set(): void { $event = $this->getTestEvent(); @@ -88,9 +77,7 @@ public function it_changes_name_when_new_one_is_set(): void $this->assertEquals('new name', $event->getName()); } - /** - * @test - */ + #[Test] public function it_overrides_params_array_if_new_one_is_set(): void { $event = $this->getTestEvent(); @@ -100,9 +87,7 @@ public function it_overrides_params_array_if_new_one_is_set(): void $this->assertEquals(['param_new' => 'bar'], $event->getParams()); } - /** - * @test - */ + #[Test] public function it_allows_object_implementing_array_access_as_params(): void { $arrayLikeObject = new \ArrayObject(['object_param' => 'baz']); @@ -114,9 +99,7 @@ public function it_allows_object_implementing_array_access_as_params(): void $this->assertSame($arrayLikeObject, $event->getParams()); } - /** - * @test - */ + #[Test] public function it_does_not_allow_params_object_that_is_not_of_type_array_access(): void { $this->expectException(\InvalidArgumentException::class); @@ -128,9 +111,7 @@ public function it_does_not_allow_params_object_that_is_not_of_type_array_access $this->getTestEvent()->setParams($stdObj); } - /** - * @test - */ + #[Test] public function it_changes_target_if_new_is_set(): void { $event = $this->getTestEvent(); @@ -142,9 +123,7 @@ public function it_changes_target_if_new_is_set(): void $this->assertSame($target, $event->getTarget()); } - /** - * @test - */ + #[Test] public function it_indicates_that_propagation_should_be_stopped(): void { $event = $this->getTestEvent(); diff --git a/tests/Event/ProophActionEventEmitterTest.php b/tests/Event/ProophActionEventEmitterTest.php index 3b95331..5af5a60 100644 --- a/tests/Event/ProophActionEventEmitterTest.php +++ b/tests/Event/ProophActionEventEmitterTest.php @@ -13,6 +13,7 @@ namespace ProophTest\Common\Event; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Event\ActionEvent; use Prooph\Common\Event\ListenerHandler; @@ -29,9 +30,7 @@ protected function setUp(): void $this->proophActionEventEmitter = new ProophActionEventEmitter(); } - /** - * @test - */ + #[Test] public function it_attaches_action_event_listeners_and_dispatch_event_to_them(): void { $lastEvent = null; @@ -52,9 +51,7 @@ public function it_attaches_action_event_listeners_and_dispatch_event_to_them(): $this->assertSame($lastEvent, $listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_detaches_a_listener(): void { $lastEvent = null; @@ -78,9 +75,7 @@ public function it_detaches_a_listener(): void $this->assertSame($actionEvent, $lastEvent); } - /** - * @test - */ + #[Test] public function it_triggers_listeners_until_callback_returns_true(): void { $lastEvent = null; @@ -103,9 +98,7 @@ public function it_triggers_listeners_until_callback_returns_true(): void $this->assertSame($actionEvent, $listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_stops_dispatching_when_event_propagation_is_stopped(): void { $lastEvent = null; @@ -131,9 +124,7 @@ public function it_stops_dispatching_when_event_propagation_is_stopped(): void $this->assertSame($actionEvent, $listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_stops_dispatching_when_event_propagation_is_stopped_2(): void { $lastEvent = null; @@ -160,9 +151,7 @@ public function it_stops_dispatching_when_event_propagation_is_stopped_2(): void $this->assertSame($actionEvent, $listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_triggers_listeners_with_high_priority_first(): void { $lastEvent = null; @@ -188,9 +177,7 @@ public function it_triggers_listeners_with_high_priority_first(): void $this->assertNull($listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_attaches_a_listener_aggregate(): void { $listener1 = new ActionEventListenerMock(); @@ -207,9 +194,7 @@ public function it_attaches_a_listener_aggregate(): void $this->assertNull($listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_detaches_listener_aggregate(): void { $listener1 = new ActionEventListenerMock(); @@ -227,48 +212,44 @@ public function it_detaches_listener_aggregate(): void $this->assertSame($actionEvent, $listener1->lastEvent); } - /** - * @test - */ + #[Test] public function it_uses_default_event_name_if_none_given(): void { $event = $this->proophActionEventEmitter->getNewActionEvent(); $this->assertEquals('action_event', $event->getName()); } - /** - * @test - */ + #[Test] public function it_returns_false_when_unattached_listener_handler_gets_detached(): void { - $listener = $this->getMockForAbstractClass(ListenerHandler::class); + $listener = $this->getMockBuilder(ListenerHandler::class) + ->onlyMethods(['getActionEventListener']) + ->getMock(); $this->assertFalse($this->proophActionEventEmitter->detachListener($listener)); } - /** - * @test - */ - public function it_dispatches_until_whith_no_listeners_attached(): void + #[Test] + public function it_dispatches_until_with_no_listeners_attached(): void { + $this->expectNotToPerformAssertions(); + $actionEventMock = $this->createMock(ActionEvent::class); $this->proophActionEventEmitter->dispatchUntil($actionEventMock, fn () => true); } - /** - * @test - */ + #[Test] public function it_attaches_to_known_event_names(): void { + $this->expectNotToPerformAssertions(); + $proophActionEventEmitter = new ProophActionEventEmitter(['foo']); $proophActionEventEmitter->attachListener('foo', function (): void { }); } - /** - * @test - */ + #[Test] public function it_does_not_attach_to_unknown_event_names(): void { $this->expectException(\InvalidArgumentException::class); diff --git a/tests/Messaging/CommandTest.php b/tests/Messaging/CommandTest.php index 1d2556f..d379630 100644 --- a/tests/Messaging/CommandTest.php +++ b/tests/Messaging/CommandTest.php @@ -15,6 +15,7 @@ use DateTimeImmutable; use DateTimeZone; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\Command; use Prooph\Common\Messaging\DomainMessage; @@ -44,49 +45,37 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[Test] public function it_has_a_name(): void { $this->assertEquals('TestCommand', $this->command->messageName()); } - /** - * @test - */ + #[Test] public function it_has_a_uuid(): void { $this->assertTrue($this->uuid->equals($this->command->uuid())); } - /** - * @test - */ + #[Test] public function it_has_created_at_information(): void { $this->assertEquals($this->createdAt->format(\DateTime::ISO8601), $this->command->createdAt()->format(\DateTime::ISO8601)); } - /** - * @test - */ + #[Test] public function it_has_payload(): void { $this->assertEquals(['command' => 'payload'], $this->command->payload()); } - /** - * @test - */ + #[Test] public function it_has_metadata(): void { $this->assertEquals(['command' => 'metadata'], $this->command->metadata()); } - /** - * @test - */ + #[Test] public function it_can_be_converted_to_array_and_back(): void { $commandData = $this->command->toArray(); @@ -96,9 +85,7 @@ public function it_can_be_converted_to_array_and_back(): void $this->assertEquals($commandData, $commandCopy->toArray()); } - /** - * @test - */ + #[Test] public function it_returns_new_instance_with_replaced_metadata(): void { $newCommand = $this->command->withMetadata(['other' => 'metadata']); @@ -108,9 +95,7 @@ public function it_returns_new_instance_with_replaced_metadata(): void $this->assertEquals(['other' => 'metadata'], $newCommand->metadata()); } - /** - * @test - */ + #[Test] public function it_returns_new_instance_with_added_metadata(): void { $newCommand = $this->command->withAddedMetadata('other', 'metadata'); @@ -120,9 +105,7 @@ public function it_returns_new_instance_with_added_metadata(): void $this->assertEquals(['command' => 'metadata', 'other' => 'metadata'], $newCommand->metadata()); } - /** - * @test - */ + #[Test] public function it_is_initialized_with_defaults(): void { $command = new DoSomething(['command' => 'payload']); @@ -134,9 +117,7 @@ public function it_is_initialized_with_defaults(): void $this->assertEquals([], $command->metadata()); } - /** - * @test - */ + #[Test] public function it_is_of_type_command(): void { $this->assertEquals(DomainMessage::TYPE_COMMAND, $this->command->messageType()); diff --git a/tests/Messaging/DomainEventTest.php b/tests/Messaging/DomainEventTest.php index a1cfbb5..7c9e768 100644 --- a/tests/Messaging/DomainEventTest.php +++ b/tests/Messaging/DomainEventTest.php @@ -15,6 +15,7 @@ use DateTimeImmutable; use DateTimeZone; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\DomainEvent; use Prooph\Common\Messaging\DomainMessage; @@ -44,49 +45,37 @@ protected function setUp(): void ]); } - /** - * @test - */ + #[Test] public function it_has_a_name(): void { $this->assertEquals('TestDomainEvent', $this->domainEvent->messageName()); } - /** - * @test - */ + #[Test] public function it_has_a_uuid(): void { $this->assertTrue($this->uuid->equals($this->domainEvent->uuid())); } - /** - * @test - */ + #[Test] public function it_has_created_at_information(): void { $this->assertEquals($this->createdAt->format(\DateTime::ISO8601), $this->domainEvent->createdAt()->format(\DateTime::ISO8601)); } - /** - * @test - */ + #[Test] public function it_has_payload(): void { $this->assertEquals(['event' => 'payload'], $this->domainEvent->payload()); } - /** - * @test - */ + #[Test] public function it_has_metadata(): void { $this->assertEquals(['event' => 'metadata'], $this->domainEvent->metadata()); } - /** - * @test - */ + #[Test] public function it_can_be_converted_to_array_and_back(): void { $commandData = $this->domainEvent->toArray(); @@ -96,9 +85,7 @@ public function it_can_be_converted_to_array_and_back(): void $this->assertEquals($commandData, $commandCopy->toArray()); } - /** - * @test - */ + #[Test] public function it_is_of_type_event(): void { $this->assertEquals(DomainMessage::TYPE_EVENT, $this->domainEvent->messageType()); diff --git a/tests/Messaging/FQCNMessageFactoryTest.php b/tests/Messaging/FQCNMessageFactoryTest.php index f0e55e3..e54d411 100644 --- a/tests/Messaging/FQCNMessageFactoryTest.php +++ b/tests/Messaging/FQCNMessageFactoryTest.php @@ -14,6 +14,7 @@ namespace ProophTest\Common\Messaging; use DateTimeImmutable; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\FQCNMessageFactory; use ProophTest\Common\Mock\DoSomething; @@ -29,9 +30,7 @@ protected function setUp(): void $this->messageFactory = new FQCNMessageFactory(); } - /** - * @test - */ + #[Test] public function it_creates_a_new_message_from_array_and_fqcn(): void { $uuid = Uuid::uuid4(); @@ -51,9 +50,7 @@ public function it_creates_a_new_message_from_array_and_fqcn(): void $this->assertEquals(['command' => 'metadata'], $command->metadata()); } - /** - * @test - */ + #[Test] public function it_creates_a_new_message_with_defaults_from_array_and_fqcn(): void { $command = $this->messageFactory->createMessageFromArray(DoSomething::class, [ @@ -65,9 +62,7 @@ public function it_creates_a_new_message_with_defaults_from_array_and_fqcn(): vo $this->assertEquals([], $command->metadata()); } - /** - * @test - */ + #[Test] public function it_throws_exception_when_message_class_cannot_be_found(): void { $this->expectException(\UnexpectedValueException::class); @@ -75,9 +70,7 @@ public function it_throws_exception_when_message_class_cannot_be_found(): void $this->messageFactory->createMessageFromArray('NotExistingClass', []); } - /** - * @test - */ + #[Test] public function it_throws_exception_when_message_class_is_not_a_sub_class_domain_message(): void { $this->expectException(\UnexpectedValueException::class); diff --git a/tests/Messaging/MessageDataAssertionTest.php b/tests/Messaging/MessageDataAssertionTest.php index a927aa0..40c1826 100644 --- a/tests/Messaging/MessageDataAssertionTest.php +++ b/tests/Messaging/MessageDataAssertionTest.php @@ -14,6 +14,8 @@ namespace ProophTest\Common\Messaging; use InvalidArgumentException; +use PHPUnit\Framework\Attributes\DataProvider; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\MessageDataAssertion; use Prooph\Common\Messaging\NoOpMessageConverter; @@ -22,9 +24,7 @@ class MessageDataAssertionTest extends TestCase { - /** - * @test - */ + #[Test] public function it_asserts_message_data_returned_by_the_no_op_message_converter(): void { $testAssertions = new DoSomething(['test' => 'assertions', ['null' => null]]); @@ -37,11 +37,8 @@ public function it_asserts_message_data_returned_by_the_no_op_message_converter( $this->assertTrue(true); } - /** - * @test - * @dataProvider - * @dataProvider provideMessageDataWithMissingKey - */ + #[Test] + #[DataProvider('provideMessageDataWithMissingKey')] public function it_throws_exception_if_message_data_is_invalid($messageData, $errorMessage) { $this->expectException(InvalidArgumentException::class); @@ -50,7 +47,7 @@ public function it_throws_exception_if_message_data_is_invalid($messageData, $er MessageDataAssertion::assert($messageData); } - public function provideMessageDataWithMissingKey() + public static function provideMessageDataWithMissingKey() { $uuid = Uuid::uuid4()->toString(); $payload = ['foo' => ['bar' => ['baz' => 100]]]; diff --git a/tests/Messaging/NoOpMessageConverterTest.php b/tests/Messaging/NoOpMessageConverterTest.php index 936e013..5e62453 100644 --- a/tests/Messaging/NoOpMessageConverterTest.php +++ b/tests/Messaging/NoOpMessageConverterTest.php @@ -14,6 +14,8 @@ namespace ProophTest\Common\Messaging; use Assert\InvalidArgumentException; +use PHPUnit\Framework\Attributes\Test; +use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\DomainMessage; use Prooph\Common\Messaging\Message; @@ -21,27 +23,30 @@ class NoOpMessageConverterTest extends TestCase { - /** - * @test - */ + #[Test] public function it_converts_to_array(): void { - $messageMock = $this->getMockForAbstractClass(DomainMessage::class, [], '', true, true, true, ['toArray']); + /** @var DomainMessage|MockObject $messageMock */ + $messageMock = $this->getMockBuilder(DomainMessage::class) + ->disableOriginalConstructor() + ->onlyMethods(['toArray', 'setPayload', 'messageType', 'payload']) + ->getMock(); + $messageMock->expects($this->once())->method('toArray'); $converter = new NoOpMessageConverter(); $converter->convertToArray($messageMock); } - /** - * @test - */ + #[Test] public function it_throws_exception_when_message_is_not_a_domain_message(): void { $this->expectException(InvalidArgumentException::class); $this->expectExceptionMessage('was expected to be instanceof of "Prooph\Common\Messaging\DomainMessage" but is not'); - $messageMock = $this->getMockForAbstractClass(Message::class); + /** @var Message|MockObject $messageMock */ + $messageMock = $this->getMockBuilder(Message::class) + ->getMock(); $converter = new NoOpMessageConverter(); $converter->convertToArray($messageMock); diff --git a/tests/Messaging/QueryTest.php b/tests/Messaging/QueryTest.php index 2e70d95..75a5836 100644 --- a/tests/Messaging/QueryTest.php +++ b/tests/Messaging/QueryTest.php @@ -13,6 +13,7 @@ namespace ProophTest\Common\Messaging; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; use Prooph\Common\Messaging\DomainMessage; use ProophTest\Common\Mock\AskSomething; @@ -20,9 +21,7 @@ class QueryTest extends TestCase { - /** - * @test - */ + #[Test] public function it_has_the_message_type_query(): void { $query = AskSomething::fromArray([