@@ -16,20 +16,20 @@ class Test_User_BasicAuth extends \Test\TestCase {
|
||||
return include(__DIR__.'/config.php');
|
||||
}
|
||||
|
||||
function skip() {
|
||||
$config=$this->getConfig();
|
||||
public function skip() {
|
||||
$config = $this->getConfig();
|
||||
$this->skipUnless($config['basic_auth']['run']);
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$config=$this->getConfig();
|
||||
$this->instance=new OC_User_BasicAuth($config['basic_auth']['url']);
|
||||
$config = $this->getConfig();
|
||||
$this->instance = new OC_User_BasicAuth($config['basic_auth']['url']);
|
||||
}
|
||||
|
||||
function testLogin() {
|
||||
$config=$this->getConfig();
|
||||
$this->assertEquals($config['basic_auth']['user'],$this->instance->checkPassword($config['basic_auth']['user'],$config['basic_auth']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['basic_auth']['user'],$config['basic_auth']['password'].'foo'));
|
||||
public function testLogin() {
|
||||
$config = $this->getConfig();
|
||||
$this->assertEquals($config['basic_auth']['user'], $this->instance->checkPassword($config['basic_auth']['user'], $config['basic_auth']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['basic_auth']['user'], $config['basic_auth']['password'].'foo'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
|
||||
if (!defined('PHPUNIT_RUN')) {
|
||||
define('PHPUNIT_RUN', 1);
|
||||
}
|
||||
@@ -9,7 +10,7 @@ if (!class_exists('\PHPUnit\Framework\TestCase')) {
|
||||
\OC_App::loadApp('user_external');
|
||||
|
||||
$dummyClass = \OC::$SERVERROOT . '/tests/lib/Util/User/Dummy.php';
|
||||
if(file_exists($dummyClass)) {
|
||||
if (file_exists($dummyClass)) {
|
||||
require_once($dummyClass);
|
||||
}
|
||||
OC_Hook::clear();
|
||||
|
||||
@@ -8,28 +8,28 @@
|
||||
|
||||
OC_App::loadApp('user_external');
|
||||
return array(
|
||||
'imap'=>array(
|
||||
'run'=>false,
|
||||
'mailbox'=>'{imap.gmail.com:993/imap/ssl}INBOX', //see http://php.net/manual/en/function.imap-open.php
|
||||
'user'=>'foo',//valid username/password combination
|
||||
'password'=>'bar',
|
||||
'imap' => array(
|
||||
'run' => false,
|
||||
'mailbox' => '{imap.gmail.com:993/imap/ssl}INBOX', //see http://php.net/manual/en/function.imap-open.php
|
||||
'user' => 'foo',//valid username/password combination
|
||||
'password' => 'bar',
|
||||
),
|
||||
'smb'=>array(
|
||||
'run'=>false,
|
||||
'host'=>'localhost',
|
||||
'user'=>'test',//valid username/password combination
|
||||
'password'=>'test',
|
||||
'smb' => array(
|
||||
'run' => false,
|
||||
'host' => 'localhost',
|
||||
'user' => 'test',//valid username/password combination
|
||||
'password' => 'test',
|
||||
),
|
||||
'ftp'=>array(
|
||||
'run'=>false,
|
||||
'host'=>'localhost',
|
||||
'user'=>'test',//valid username/password combination
|
||||
'password'=>'test',
|
||||
'ftp' => array(
|
||||
'run' => false,
|
||||
'host' => 'localhost',
|
||||
'user' => 'test',//valid username/password combination
|
||||
'password' => 'test',
|
||||
),
|
||||
'basic_auth'=>array(
|
||||
'run'=>false,
|
||||
'url'=>'localhost/basic_auth',
|
||||
'user'=>'test',//valid username/password combination
|
||||
'password'=>'test',
|
||||
'basic_auth' => array(
|
||||
'run' => false,
|
||||
'url' => 'localhost/basic_auth',
|
||||
'user' => 'test',//valid username/password combination
|
||||
'password' => 'test',
|
||||
),
|
||||
);
|
||||
|
||||
@@ -16,20 +16,20 @@ class Test_User_FTP extends \Test\TestCase {
|
||||
return include(__DIR__.'/config.php');
|
||||
}
|
||||
|
||||
function skip() {
|
||||
$config=$this->getConfig();
|
||||
public function skip() {
|
||||
$config = $this->getConfig();
|
||||
$this->skipUnless($config['ftp']['run']);
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$config=$this->getConfig();
|
||||
$this->instance=new OC_User_FTP($config['ftp']['host']);
|
||||
$config = $this->getConfig();
|
||||
$this->instance = new OC_User_FTP($config['ftp']['host']);
|
||||
}
|
||||
|
||||
function testLogin() {
|
||||
$config=$this->getConfig();
|
||||
$this->assertEquals($config['ftp']['user'],$this->instance->checkPassword($config['ftp']['user'],$config['ftp']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['ftp']['user'],$config['ftp']['password'].'foo'));
|
||||
public function testLogin() {
|
||||
$config = $this->getConfig();
|
||||
$this->assertEquals($config['ftp']['user'], $this->instance->checkPassword($config['ftp']['user'], $config['ftp']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['ftp']['user'], $config['ftp']['password'].'foo'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,21 @@ class Test_User_Imap extends \Test\TestCase {
|
||||
return include(__DIR__.'/config.php');
|
||||
}
|
||||
|
||||
function skip() {
|
||||
$config=$this->getConfig();
|
||||
public function skip() {
|
||||
$config = $this->getConfig();
|
||||
$this->skipUnless($config['imap']['run']);
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$config=$this->getConfig();
|
||||
$this->instance=new OC_User_IMAP($config['imap']['mailbox']);
|
||||
$config = $this->getConfig();
|
||||
$this->instance = new OC_User_IMAP($config['imap']['mailbox']);
|
||||
}
|
||||
|
||||
function testLogin() {
|
||||
$config=$this->getConfig();
|
||||
$this->assertEquals($config['imap']['user'],$this->instance->checkPassword($config['imap']['user'],$config['imap']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['imap']['user'],$config['imap']['password'].'foo'));
|
||||
public function testLogin() {
|
||||
$config = $this->getConfig();
|
||||
$this->assertEquals($config['imap']['user'], $this->instance->checkPassword($config['imap']['user'], $config['imap']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['imap']['user'], $config['imap']['password'].'foo'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,21 +16,21 @@ class Test_User_SMB extends \Test\TestCase {
|
||||
return include(__DIR__.'/config.php');
|
||||
}
|
||||
|
||||
function skip() {
|
||||
$config=$this->getConfig();
|
||||
public function skip() {
|
||||
$config = $this->getConfig();
|
||||
$this->skipUnless($config['smb']['run']);
|
||||
}
|
||||
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
|
||||
$config=$this->getConfig();
|
||||
$this->instance=new OC_User_SMB($config['smb']['host']);
|
||||
$config = $this->getConfig();
|
||||
$this->instance = new OC_User_SMB($config['smb']['host']);
|
||||
}
|
||||
|
||||
function testLogin() {
|
||||
$config=$this->getConfig();
|
||||
$this->assertEquals($config['smb']['user'],$this->instance->checkPassword($config['smb']['user'],$config['smb']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['smb']['user'],$config['smb']['password'].'foo'));
|
||||
public function testLogin() {
|
||||
$config = $this->getConfig();
|
||||
$this->assertEquals($config['smb']['user'], $this->instance->checkPassword($config['smb']['user'], $config['smb']['password']));
|
||||
$this->assertFalse($this->instance->checkPassword($config['smb']['user'], $config['smb']['password'].'foo'));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user