Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

remove @deprecated class and method #2

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 0 additions & 17 deletions src/Adapter/DbTable.php

This file was deleted.

17 changes: 0 additions & 17 deletions src/Adapter/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -371,23 +371,6 @@ public function authenticate()
return $result;
}

/**
* @deprecated
* @see Http::challengeClient()
* @return Authentication\Result Always returns a non-identity Auth result
*/
protected function _challengeClient()
{
trigger_error(sprintf(
'The method "%s" is deprecated and will be removed in the future; '
. 'please use the public method "%s::challengeClient()" instead',
__METHOD__,
__CLASS__
), E_USER_DEPRECATED);

return $this->challengeClient();
}

/**
* Challenge Client
*
Expand Down
8 changes: 4 additions & 4 deletions test/Adapter/DbTable/CallbackCheckAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand All @@ -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();
}

Expand Down
8 changes: 4 additions & 4 deletions test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand All @@ -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();
}

Expand Down
8 changes: 4 additions & 4 deletions test/Adapter/DbTable/CredentialTreatmentAdapterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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();
}

Expand All @@ -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();
}

Expand All @@ -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();
}

Expand Down
24 changes: 0 additions & 24 deletions test/Adapter/DbTableTest.php

This file was deleted.

19 changes: 5 additions & 14 deletions test/Adapter/HttpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
namespace ZendTest\Authentication\Adapter;

use Zend\Authentication\Adapter;
use Zend\Http\Response;

class HttpTest extends \PHPUnit_Framework_TestCase
{
Expand All @@ -26,27 +27,17 @@ public function setUp()
'realm' => 'testing',
];

$this->_wrapper = new Wrapper($config);
$this->_wrapper = new Adapter\Http($config);
}

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();
}
}