Skip to content

Commit

Permalink
Function that exposes the current Sag::* value.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbisbee committed Nov 7, 2011
1 parent badb6c1 commit 24b9ad0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/Sag.php
Expand Up @@ -132,6 +132,16 @@ public function setHTTPAdapter($type = null) {
return $this;
}

/**
* Returns the current HTTP adapter being used.
*
* @return string Will be equal to Sag::$HTTP_NATIVE_SOCKETS or
* Sag::$HTTP_CURL.
*/
public function currentHTTPAdapter() {
return $this->httpAdapterType;
}

/**
* Updates the login credentials in Sag that will be used for all further
* communications. Pass null to both $user and $pass to turn off
Expand Down
4 changes: 4 additions & 0 deletions tests/SagTest.php
Expand Up @@ -63,6 +63,10 @@ public function setUp()
$this->noCacheCouch->login($this->couchAdminName, $this->couchAdminPass);
}

public function test_currentHTTPAdapter() {
$this->assertEquals($this->couch->currentHTTPAdapter(), $this->couchHTTPAdapter);
}

public function test_createDB()
{
$result = $this->couch->createDatabase($this->couchDBName);
Expand Down

0 comments on commit 24b9ad0

Please sign in to comment.