File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ public function getName()
57
57
* @throws \Http\Client\Exception
58
58
* @throws Exception
59
59
*/
60
- public function call (string $ function , array ...$ arguments )
60
+ public function call (string $ function , ...$ arguments )
61
61
{
62
62
if (!$ this ->mtaService ) {
63
63
throw new Exception (sprintf (self ::UNDEFINED_SERVICE_EXCEPTION , $ this ->name ));
Original file line number Diff line number Diff line change @@ -86,6 +86,29 @@ public function testItReturnsResponseUsingDirectCall(): void
86
86
$ this ->assertEquals ('someElementId ' , $ return [2 ]->getId ());
87
87
}
88
88
89
+ public function testItAcceptsScalarParameter (): void
90
+ {
91
+ $ response = $ this ->prophesize (ResponseInterface::class);
92
+ $ response
93
+ ->getBody ()
94
+ ->willReturn ('["^R^someResource","someString","^E^someElementId"] ' );
95
+ $ response
96
+ ->getStatusCode ()
97
+ ->willReturn (200 );
98
+ $ response = $ response ->reveal ();
99
+
100
+ $ client = new Client ();
101
+ $ client ->addResponse ($ response );
102
+
103
+ $ server = new Server ('127.0.0.1 ' , 22005 );
104
+ $ credential = new Authentication ('someUser ' , 'somePassword ' );
105
+
106
+ $ mta = new Mta ($ server , $ credential , $ client );
107
+ $ return = $ mta ->getResource ('someCallableResource ' )->call ->someCallableFunction (1 , "Test " );
108
+
109
+ $ this ->assertIsArray ($ return );
110
+ }
111
+
89
112
public function testItPrintsSomeJson (): void
90
113
{
91
114
Mta::doReturn ('someValue1 ' , 'someValue2 ' );
You can’t perform that action at this time.
0 commit comments