Пример #1
0
 /**
  * @throws Exceptions\CapabilityUnavailable
  * @throws Exceptions\MissingConfiguration
  * @returns Bulletin
  */
 public function Login()
 {
     if (!$this->configuration or !$this->configuration->valid()) {
         throw new MissingConfiguration("Cannot issue Login without a valid configuration loaded");
     }
     $response = $this->request('Login');
     $parser = $this->grab('parser.login');
     $parser->parse($response->xml()->{'RETS-RESPONSE'}->__toString());
     foreach ($parser->getCapabilities() as $k => $v) {
         $this->capabilities->add($k, $v);
     }
     $bulletin = new Bulletin();
     if ($this->capabilities->get('Action')) {
         $response = $this->request('Action');
         $bulletin->setBody($response->getBody()->__toString());
         return $bulletin;
     } else {
         return $bulletin;
     }
 }
Пример #2
0
 public function testDetailsAreMadeAvailable()
 {
     $bulletin = new Bulletin(['Test' => 'Value']);
     $this->assertSame('Value', $bulletin->getDetail('Test'));
 }