Skip to content
Open
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
11 changes: 2 additions & 9 deletions tests/lib/AppFramework/Bootstrap/FunctionInjectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
}
23 changes: 5 additions & 18 deletions tests/lib/Hooks/BasicEmitterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,17 +153,17 @@ 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;
};
$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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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);
}


Expand All @@ -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);
}


Expand All @@ -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);
}


Expand All @@ -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);
}


Expand All @@ -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);
}
}
Loading