Skip to content

Add PoC for testing utilities: AggregateTestCase, SubscriberUtilities #4972

Add PoC for testing utilities: AggregateTestCase, SubscriberUtilities

Add PoC for testing utilities: AggregateTestCase, SubscriberUtilities #4972

Triggered via pull request January 3, 2025 12:02
Status Failure
Total duration 35s
Artifacts

psalm.yml

on: pull_request
Matrix: Static Analysis by Psalm
Fit to window
Zoom out
Zoom in

Annotations

10 errors and 1 warning
InternalClass: src/Test/AggregateRootTestCase.php#L132
src/Test/AggregateRootTestCase.php:132:17: InternalClass: PHPUnit\Framework\Constraint\Exception is internal to PHPUnit but called from Patchlevel\EventSourcing\Test\AggregateRootTestCase (see https://psalm.dev/174)
InternalMethod: src/Test/AggregateRootTestCase.php#L132
src/Test/AggregateRootTestCase.php:132:17: InternalMethod: Constructor PHPUnit\Framework\Constraint\Exception::__construct is internal to PHPUnit but called from Patchlevel\EventSourcing\Test\AggregateRootTestCase::handleException (see https://psalm.dev/175)
RiskyTruthyFalsyComparison: src/Test/AggregateRootTestCase.php#L138
src/Test/AggregateRootTestCase.php:138:13: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
InternalClass: src/Test/AggregateRootTestCase.php#L144
src/Test/AggregateRootTestCase.php:144:13: InternalClass: PHPUnit\Framework\Constraint\ExceptionMessageIsOrContains is internal to PHPUnit but called from Patchlevel\EventSourcing\Test\AggregateRootTestCase (see https://psalm.dev/174)
InternalMethod: src/Test/AggregateRootTestCase.php#L144
src/Test/AggregateRootTestCase.php:144:13: InternalMethod: Constructor PHPUnit\Framework\Constraint\ExceptionMessageIsOrContains::__construct is internal to PHPUnit but called from Patchlevel\EventSourcing\Test\AggregateRootTestCase::handleException (see https://psalm.dev/175)
MissingConstructor: src/Test/SubscriberUtilities.php#L17
src/Test/SubscriberUtilities.php:17:22: MissingConstructor: Patchlevel\EventSourcing\Tests\Unit\Test\_home_runner_work_event_sourcing_event_sourcing_tests_Unit_Test_SubscriberUtilitiesTest_php_146_3568 has an uninitialized property Patchlevel\EventSourcing\Test\SubscriberUtilities::$subscriberAccessors, but no constructor (see https://psalm.dev/073)
RedundantPropertyInitializationCheck: src/Test/SubscriberUtilities.php#L89
src/Test/SubscriberUtilities.php:89:16: RedundantPropertyInitializationCheck: Property $this->subscriberAccessors with type array<array-key, Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor> should already be set in the constructor (see https://psalm.dev/261)
InvalidPropertyAssignmentValue: src/Test/SubscriberUtilities.php#L89
src/Test/SubscriberUtilities.php:89:16: InvalidPropertyAssignmentValue: $this->subscriberAccessors with declared type 'array<array-key, Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor>' cannot be assigned type 'iterable<array-key|mixed, Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor|Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor<object>>' (see https://psalm.dev/145)
RedundantPropertyInitializationCheck: src/Test/SubscriberUtilities.php#L89
src/Test/SubscriberUtilities.php:89:47: RedundantPropertyInitializationCheck: Property $this->subscriberAccessors with type array<array-key, Patchlevel\EventSourcing\Subscription\Subscriber\MetadataSubscriberAccessor> should already be set in the constructor (see https://psalm.dev/261)
InternalMethod: tests/Unit/Test/AggregateRootTestCaseTest.php#L253
tests/Unit/Test/AggregateRootTestCaseTest.php:253:16: InternalMethod: Constructor PHPUnit\Framework\TestCase::__construct is internal to PHPUnit but called from Patchlevel\EventSourcing\Tests\Unit\Test\AggregateRootTestCaseTest::getTester (see https://psalm.dev/175)
Static Analysis by Psalm (locked, 8.3, ubuntu-latest)
ubuntu-latest pipelines will use ubuntu-24.04 soon. For more details, see https://github.com/actions/runner-images/issues/10636