Skip to content

Commit d1d2df1

Browse files
committed
Add test for additional provided parameters
1 parent 06f0b06 commit d1d2df1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/DispatcherTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,5 +72,17 @@ public function testCallMethodWithTypeHintWithNamedArgsOnNestedTarget()
7272
$this->assertEquals($this->callsOfNestedTarget, [new MethodCall('someMethodWithTypeHint', [new Argument('whatever')])]);
7373
}
7474

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

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

0 commit comments

Comments
 (0)