Skip to content

Commit

Permalink
test: Add test for additional provided parameters (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyvdSluijs authored May 19, 2023
1 parent b5f37db commit 6bd8682
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,5 +72,17 @@ public function testCallMethodWithTypeHintWithNamedArgsOnNestedTarget()
$this->assertEquals($this->callsOfNestedTarget, [new MethodCall('someMethodWithTypeHint', [new Argument('whatever')])]);
}

public function testCallMethodWithAdditionalProvidedParamsOnSomeMethodWithoutArgs()
{
$result = $this->dispatcher->dispatch((string) new Request(1, 'someMethodWithoutArgs', ['arg' => new Argument('whatever')]));
$this->assertEquals('Hello World', $result);
$this->assertEquals($this->calls, [new MethodCall('someMethodWithoutArgs', [])]);
}

public function testCallMethodWithAdditionalProvidedParamsOnSomeMethodWithTypeHint()
{
$result = $this->dispatcher->dispatch((string) new Request(1, 'someMethodWithTypeHint', ['arg' => new Argument('whatever'), 'arg2' => new Argument('anything')]));
$this->assertEquals('Hello World', $result);
$this->assertEquals($this->calls, [new MethodCall('someMethodWithTypeHint', [new Argument('whatever')])]);
}
}

0 comments on commit 6bd8682

Please sign in to comment.