diff --git a/tests/lib/AppFramework/Bootstrap/FunctionInjectorTest.php b/tests/lib/AppFramework/Bootstrap/FunctionInjectorTest.php index 168d95b9aadf7..cc6e38d1716f8 100644 --- a/tests/lib/AppFramework/Bootstrap/FunctionInjectorTest.php +++ b/tests/lib/AppFramework/Bootstrap/FunctionInjectorTest.php @@ -34,12 +34,10 @@ public function testInjectFnNotRegistered(): void { }); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testInjectFnNotRegisteredButNullable(): void { (new FunctionInjector($this->container))->injectFn(static function (?Foo $p1): void { }); - - // Nothing to assert. No errors means everything is fine. - $this->addToAssertionCount(1); } public function testInjectFnByType(): void { @@ -51,18 +49,13 @@ public function testInjectFnByType(): void { (new FunctionInjector($this->container))->injectFn(static function (Foo $p1): void { }); - - // Nothing to assert. No errors means everything is fine. - $this->addToAssertionCount(1); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testInjectFnByName(): void { $this->container->registerParameter('test', 'abc'); (new FunctionInjector($this->container))->injectFn(static function ($test): void { }); - - // Nothing to assert. No errors means everything is fine. - $this->addToAssertionCount(1); } } diff --git a/tests/lib/Hooks/BasicEmitterTest.php b/tests/lib/Hooks/BasicEmitterTest.php index 7657f7eca9f20..deea31cd12271 100644 --- a/tests/lib/Hooks/BasicEmitterTest.php +++ b/tests/lib/Hooks/BasicEmitterTest.php @@ -153,6 +153,7 @@ public function testNamedArguments(): void { $this->emitter->emitEvent('Test', 'test', ['foo' => 'foo', 'bar' => 'bar']); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testRemoveAllSpecified(): void { $listener = function (): void { throw new EmittedException; @@ -160,10 +161,9 @@ public function testRemoveAllSpecified(): void { $this->emitter->listen('Test', 'test', $listener); $this->emitter->removeListener('Test', 'test', $listener); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testRemoveWildcardListener(): void { $listener1 = function (): void { throw new EmittedException; @@ -175,10 +175,9 @@ public function testRemoveWildcardListener(): void { $this->emitter->listen('Test', 'test', $listener2); $this->emitter->removeListener('Test', 'test'); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testRemoveWildcardMethod(): void { $listener = function (): void { throw new EmittedException; @@ -188,10 +187,9 @@ public function testRemoveWildcardMethod(): void { $this->emitter->removeListener('Test', null, $listener); $this->emitter->emitEvent('Test', 'test'); $this->emitter->emitEvent('Test', 'foo'); - - $this->addToAssertionCount(1); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testRemoveWildcardScope(): void { $listener = function (): void { throw new EmittedException; @@ -201,10 +199,9 @@ public function testRemoveWildcardScope(): void { $this->emitter->removeListener(null, 'test', $listener); $this->emitter->emitEvent('Test', 'test'); $this->emitter->emitEvent('Bar', 'test'); - - $this->addToAssertionCount(1); } + #[\PHPUnit\Framework\Attributes\DoesNotPerformAssertions] public function testRemoveWildcardScopeAndMethod(): void { $listener = function (): void { throw new EmittedException; @@ -216,8 +213,6 @@ public function testRemoveWildcardScopeAndMethod(): void { $this->emitter->emitEvent('Test', 'test'); $this->emitter->emitEvent('Test', 'foo'); $this->emitter->emitEvent('Bar', 'foo'); - - $this->addToAssertionCount(1); } @@ -234,8 +229,6 @@ public function testRemoveKeepOtherCallback(): void { $this->emitter->listen('Test', 'test', $listener2); $this->emitter->removeListener('Test', 'test', $listener1); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } @@ -249,8 +242,6 @@ public function testRemoveKeepOtherMethod(): void { $this->emitter->listen('Test', 'foo', $listener); $this->emitter->removeListener('Test', 'foo', $listener); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } @@ -264,8 +255,6 @@ public function testRemoveKeepOtherScope(): void { $this->emitter->listen('Bar', 'test', $listener); $this->emitter->removeListener('Bar', 'test', $listener); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } @@ -278,7 +267,5 @@ public function testRemoveNonExistingName(): void { $this->emitter->listen('Test', 'test', $listener); $this->emitter->removeListener('Bar', 'test', $listener); $this->emitter->emitEvent('Test', 'test'); - - $this->addToAssertionCount(1); } }