public static function get($configFilename = 'rets.yml')
 {
     $c = self::getRawConfig($configFilename);
     $retsConfig = new Configuration();
     $retsConfig->setLoginUrl($c['url'])->setUsername($c['username'])->setPassword($c['password'])->setRetsVersion($c['rets_version'])->setUserAgent($c['user_agent'])->setUserAgentPassword($c['user_agent_password'])->setHttpAuthenticationMethod($c['http_auth_method'])->setOption('use_post_method', $c['use_post_method'])->setOption('disable_follow_location', $c['disable_follow_location']);
     return $retsConfig;
 }
Example #2
0
 public function setUp()
 {
     $parser = new OneX();
     $parameters = ['SearchType' => 'Property', 'Class' => 'A', 'RestrictedIndicator' => '#####'];
     $data = "\n        <RETS ReplyCode=\"0\" ReplyText=\"Success\">\n          <COUNT Records=\"9057\"/>\n          <DELIMITER value=\"09\"/>\n          <COLUMNS>\tLIST_1\tLIST_105\t</COLUMNS>\n          <DATA>\t20111007152642181995000000\t12-5\t</DATA>\n          <DATA>\t20081003152306903177000000\t07-310\t</DATA>\n          <DATA>\t20081216155101459601000000\t07-340\t</DATA>\n          <MAXROWS/>\n        </RETS>\n        ";
     $c = new Configuration();
     $c->setLoginUrl('http://www.reso.org/login');
     $s = new Session($c);
     $this->results = $parser->parse($s, new Response(200, [], Stream::factory($data)), $parameters);
 }
Example #3
0
 /** @test **/
 public function it_allows_overriding_the_cookie_jar()
 {
     $c = new Configuration();
     $c->setLoginUrl('http://www.reso.org/login');
     $s = new Session($c);
     $jar = new \GuzzleHttp\Cookie\CookieJar();
     $s->setCookieJar($jar);
     $this->assertSame($jar, $s->getCookieJar());
 }
Example #4
0
 /** @test **/
 public function it_generates_user_agent_auth_hashes_correctly()
 {
     $c = new Configuration();
     $c->setLoginUrl('http://www.reso.org/login')->setUserAgent('PHRETS/2.0')->setUserAgentPassword('12345')->setRetsVersion('1.7.2');
     $s = new \PHRETS\Session($c);
     $this->assertSame('123c96e02e514da469db6bc61ab998dc', $c->userAgentDigestHash($s));
 }