Exemple #1
0
 /**
  * Test version string
  *
  * @assert     equals
  *
  * @author     Simon Thulbourn <*****@*****.**>
  */
 public function testVersionString()
 {
     $version = \phpcouch\VERSION_NUMBER;
     // only append a status (like "RC3") if it is set
     if (\phpcouch\VERSION_STATUS !== null) {
         $version .= '-' . \phpcouch\VERSION_STATUS;
     }
     $this->assertEquals(Phpcouch::getVersionString(), 'PHPCouch/' . $version);
 }
Exemple #2
0
 /**
  * Adapter constructor.
  *
  * @param      array An array of initialization options for this driver implementation.
  *
  * @author     David Zülke <*****@*****.**>
  * @since      1.0.0
  */
 public function __construct(array $options = array())
 {
     $this->options = array('http' => array('header' => array('Accept: */*, application/json'), 'ignore_errors' => true, 'user_agent' => \phpcouch\Phpcouch::getVersionString()));
     // can't do array_merge_recursive
     foreach ($options as $wrapper => $opts) {
         if (isset($this->options[$wrapper])) {
             $this->options[$wrapper] = array_merge($this->options[$wrapper], $opts);
         } else {
             $this->options[$wrapper] = $opts;
         }
     }
 }
Exemple #3
0
 /**
  * Adapter constructor.
  *
  * @param      array An array of initialization options for this driver implementation.
  *
  * @author     Simon Thulbourn <*****@*****.**>
  * @since      1.0.0
  */
 public function __construct(array $options = array())
 {
     $this->headers = array('Accept' => '*/*, application/json', 'User-Agent' => \phpcouch\Phpcouch::getVersionString());
 }