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()
5757 * @throws \Http\Client\Exception
5858 * @throws Exception
5959 */
60- public function call (string $ function , array ...$ arguments )
60+ public function call (string $ function , ...$ arguments )
6161 {
6262 if (!$ this ->mtaService ) {
6363 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
8686 $ this ->assertEquals ('someElementId ' , $ return [2 ]->getId ());
8787 }
8888
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+
89112 public function testItPrintsSomeJson (): void
90113 {
91114 Mta::doReturn ('someValue1 ' , 'someValue2 ' );
You can’t perform that action at this time.
0 commit comments