Skip to content

Commit 67da18e

Browse files
committed
Merge pull request #6 from MegaThorx/master
2 parents 139f200 + 30c54cb commit 67da18e

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

src/Model/Resource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff 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));

tests/Functional/MtaTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)