Пример #1
0
 public function testServerTimeCreationAndGetters()
 {
     $data = json_decode(file_get_contents(STUB_PATH . '/servertime.json'), true);
     /** @var $item \CarlosIO\Pingdom\ServerTime */
     $item = \CarlosIO\Pingdom\ServerTime::createFromArray($data);
     $this->assertSame(1294237910, $item->getServerTime());
 }
Пример #2
0
 /**
  * Returns a list of all server times for current account
  *
  * @throws \Exception
  * @return array<\CarlosIO\Pingdom\ServerTime>
  */
 public function getServerTime($options = array())
 {
     $response = $this->_callMethod('servertime', $options);
     $itemList = array($response);
     $result = array();
     foreach ($itemList as $item) {
         $newItem = \CarlosIO\Pingdom\ServerTime::createFromArray($item);
         $newItem->setAccount($this);
         $result[] = $newItem;
     }
     return $result;
 }