diff --git a/src/Adapter/DbTable.php b/src/Adapter/DbTable.php deleted file mode 100644 index 0edfbf2..0000000 --- a/src/Adapter/DbTable.php +++ /dev/null @@ -1,17 +0,0 @@ -challengeClient(); - } - /** * Challenge Client * diff --git a/test/Adapter/DbTable/CallbackCheckAdapterTest.php b/test/Adapter/DbTable/CallbackCheckAdapterTest.php index fc25d48..ffa2af9 100644 --- a/test/Adapter/DbTable/CallbackCheckAdapterTest.php +++ b/test/Adapter/DbTable/CallbackCheckAdapterTest.php @@ -79,7 +79,7 @@ public function testAuthenticateSuccess() */ public function testAuthenticateSuccessWithCallback() { - $this->_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password', null, function ($a, $b) {return $a === $b;}); + $this->_adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users', 'username', 'password', null, function ($a, $b) {return $a === $b;}); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); @@ -225,7 +225,7 @@ public function testCatchExceptionNoTable() { $this->setExpectedException('Zend\Authentication\Adapter\Dbtable\Exception\RuntimeException', 'A table must be supplied for'); - $adapter = new Adapter\DbTable($this->_db); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db); $adapter->authenticate(); } @@ -236,7 +236,7 @@ public function testCatchExceptionNoIdentityColumn() { $this->setExpectedException('Zend\Authentication\Adapter\Dbtable\Exception\RuntimeException', 'An identity column must be supplied for the'); - $adapter = new Adapter\DbTable($this->_db, 'users'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users'); $adapter->authenticate(); } @@ -247,7 +247,7 @@ public function testCatchExceptionNoCredentialColumn() { $this->setExpectedException('Zend\Authentication\Adapter\Dbtable\Exception\RuntimeException', 'A credential column must be supplied'); - $adapter = new Adapter\DbTable($this->_db, 'users', 'username'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users', 'username'); $adapter->authenticate(); } diff --git a/test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php b/test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php index af0868d..413ddaf 100644 --- a/test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php +++ b/test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php @@ -109,7 +109,7 @@ public function testAuthenticateSuccess() */ public function testAuthenticateSuccessWithTreatment() { - $this->authAdapter = new Adapter\DbTable($this->db, $this->tableName, 'username', 'password', '?'); + $this->authAdapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->db, $this->tableName, 'username', 'password', '?'); $this->authAdapter->setIdentity('my_username'); $this->authAdapter->setCredential('my_password'); $result = $this->authAdapter->authenticate(); @@ -249,7 +249,7 @@ public function testAdapterReturnsASelectObjectWithoutAuthTimeModificationsAfter public function testCatchExceptionNoTable() { $this->setExpectedException('Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'A table must be supplied for'); - $adapter = new Adapter\DbTable($this->db); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->db); $adapter->authenticate(); } @@ -262,7 +262,7 @@ public function testCatchExceptionNoIdentityColumn() 'Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'An identity column must be supplied for the' ); - $adapter = new Adapter\DbTable($this->db, 'users'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->db, 'users'); $adapter->authenticate(); } @@ -275,7 +275,7 @@ public function testCatchExceptionNoCredentialColumn() 'Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'A credential column must be supplied' ); - $adapter = new Adapter\DbTable($this->db, 'users', 'username'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->db, 'users', 'username'); $adapter->authenticate(); } diff --git a/test/Adapter/DbTable/CredentialTreatmentAdapterTest.php b/test/Adapter/DbTable/CredentialTreatmentAdapterTest.php index 66b594c..a36671c 100644 --- a/test/Adapter/DbTable/CredentialTreatmentAdapterTest.php +++ b/test/Adapter/DbTable/CredentialTreatmentAdapterTest.php @@ -78,7 +78,7 @@ public function testAuthenticateSuccess() */ public function testAuthenticateSuccessWithTreatment() { - $this->_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password', '?'); + $this->_adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users', 'username', 'password', '?'); $this->_adapter->setIdentity('my_username'); $this->_adapter->setCredential('my_password'); $result = $this->_adapter->authenticate(); @@ -212,7 +212,7 @@ public function testCatchExceptionNoTable() { $this->setExpectedException('Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'A table must be supplied for'); - $adapter = new Adapter\DbTable($this->_db); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db); $adapter->authenticate(); } @@ -223,7 +223,7 @@ public function testCatchExceptionNoIdentityColumn() { $this->setExpectedException('Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'An identity column must be supplied for the'); - $adapter = new Adapter\DbTable($this->_db, 'users'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users'); $adapter->authenticate(); } @@ -234,7 +234,7 @@ public function testCatchExceptionNoCredentialColumn() { $this->setExpectedException('Zend\Authentication\Adapter\DbTable\Exception\RuntimeException', 'A credential column must be supplied'); - $adapter = new Adapter\DbTable($this->_db, 'users', 'username'); + $adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users', 'username'); $adapter->authenticate(); } diff --git a/test/Adapter/DbTableTest.php b/test/Adapter/DbTableTest.php deleted file mode 100644 index 2666d27..0000000 --- a/test/Adapter/DbTableTest.php +++ /dev/null @@ -1,24 +0,0 @@ -_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password'); - } -} diff --git a/test/Adapter/HttpTest.php b/test/Adapter/HttpTest.php index 9f3991a..6118666 100644 --- a/test/Adapter/HttpTest.php +++ b/test/Adapter/HttpTest.php @@ -11,6 +11,7 @@ namespace ZendTest\Authentication\Adapter; use Zend\Authentication\Adapter; +use Zend\Http\Response; class HttpTest extends \PHPUnit_Framework_TestCase { @@ -26,7 +27,7 @@ public function setUp() 'realm' => 'testing', ]; - $this->_wrapper = new Wrapper($config); + $this->_wrapper = new Adapter\Http($config); } public function tearDown() @@ -34,19 +35,9 @@ public function tearDown() unset($this->_wrapper); } - /** - * @expectedException PHPUnit_Framework_Error_Deprecated - */ - public function testProtectedMethodChallengeClientTriggersErrorDeprecated() - { - $this->_wrapper->_challengeClient(); - } -} - -class Wrapper extends Adapter\Http -{ - public function __call($method, $args) + public function testChallengeClient() { - return call_user_func_array([$this, $method], $args); + $this->_wrapper->setResponse(new Response()); + $this->_wrapper->challengeClient(); } }