mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[feature/auth-refactor] Test for init on provider_apache
Provides a test for the init() method of provider_apache. Appears to be failing due to an error with the mock request class. PHPBB3-9734
This commit is contained in:
parent
91c80dfc8e
commit
e5de05d8db
1 changed files with 12 additions and 4 deletions
|
@ -12,6 +12,8 @@ require_once dirname(__FILE__).'/../../phpBB/includes/functions.php';
|
||||||
class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
||||||
{
|
{
|
||||||
protected $provider;
|
protected $provider;
|
||||||
|
protected $user;
|
||||||
|
protected $request;
|
||||||
|
|
||||||
protected function setup()
|
protected function setup()
|
||||||
{
|
{
|
||||||
|
@ -21,10 +23,10 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
||||||
|
|
||||||
$db = $this->new_dbal();
|
$db = $this->new_dbal();
|
||||||
$config = new phpbb_config(array());
|
$config = new phpbb_config(array());
|
||||||
$request = $this->getMock('phpbb_request');
|
$this->request = $this->getMock('phpbb_request');
|
||||||
$user = $this->getMock('phpbb_user');
|
$this->user = $this->getMock('phpbb_user');
|
||||||
|
|
||||||
$this->provider = new phpbb_auth_provider_apache($db, $config, $request, $user, $phpbb_root_path, $phpEx);
|
$this->provider = new phpbb_auth_provider_apache($db, $config, $this->request, $this->user, $phpbb_root_path, $phpEx);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDataSet()
|
public function getDataSet()
|
||||||
|
@ -32,9 +34,15 @@ class phpbb_auth_provider_apache_test extends phpbb_database_test_case
|
||||||
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
|
return $this->createXMLDataSet(dirname(__FILE__).'/fixtures/user.xml');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test to see if a user is identified to Apache. Expects false if they are.
|
||||||
|
*/
|
||||||
public function test_init()
|
public function test_init()
|
||||||
{
|
{
|
||||||
$this->markTestIncomplete();
|
$this->user->data['username'] = 'foobar';
|
||||||
|
$this->request->overwrite('PHP_AUTH_USER', 'foobar', phpbb_request_interface::SERVER);
|
||||||
|
|
||||||
|
$this->assertFalse($this->provider->init());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test_login()
|
public function test_login()
|
||||||
|
|
Loading…
Add table
Reference in a new issue