Skip to content
Open
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
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')])]);
}
}