diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index 8b54d06..49699c0 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -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')])]); + } }