Skip to content

Commit cfe6105

Browse files
committed
Updated pinger for new result object.
1 parent 309081c commit cfe6105

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
3+
namespace org\nameapi\client\services\system\ping;
4+
5+
6+
class PingerResult {
7+
8+
/**
9+
* @var string
10+
*/
11+
private $pong;
12+
13+
function __construct($pong) {
14+
$this->pong = $pong;
15+
}
16+
17+
/**
18+
* @return string the string 'pong'
19+
*/
20+
public function getPong() {
21+
return $this->pong;
22+
}
23+
24+
}

src/org/nameapi/client/services/system/pinger/PingerService.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use org\nameapi\ontology\input\context\Context;
66

77
require_once(__DIR__.'/wsdl/SoapPingerService.php');
8+
require_once(__DIR__.'/PingerResult.php');
89

910

1011
/**
@@ -28,11 +29,12 @@ public function __construct(Context $context) {
2829
}
2930

3031
/**
31-
* @return string
32+
* @return PingerResult
3233
*/
3334
public function ping() {
3435
$parameters = new wsdl\PingArguments($this->context);
35-
return $this->soapPingerService->ping($parameters)->getReturn();
36+
$result = $this->soapPingerService->ping($parameters)->getReturn();
37+
return new PingerResult($result->pong);
3638
}
3739

3840
}

tests/functional/org/nameapi/client/services/system/pinger/PingerServiceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class PingerServiceTest extends BaseServiceTest {
1111
public function testPing() {
1212
$pinger = $this->makeServiceFactory()->systemServices()->pinger();
1313
$result = $pinger->ping();
14-
$this->assertEquals('pong', $result);
14+
$this->assertEquals('pong', $result->getPong());
1515
}
1616

1717
}

0 commit comments

Comments
 (0)