Skip to content
Snippets Groups Projects
Commit 77cb3fb2 authored by gloas's avatar gloas
Browse files

AuthCommSigb ajout test cas famille

parent c79ecac7
Branches
Tags
No related merge requests found
......@@ -65,7 +65,6 @@ class AuthCommSigbAuthenticationWithoutWebServicesTest extends AuthCommSigbTestC
abstract class AuthCommSigbWithWebServicesAndAbonneZorkTestCase extends AuthCommSigbTestCase {
public function setUp() {
parent::setUp();
......@@ -200,6 +199,54 @@ class AuthCommSigbSuccessfullAuthenticationWithExistingUserTest extends AuthComm
class AuthCommSigbSuccessfullAuthenticationWithExistingFamilleUserTest extends AuthCommSigbWithWebServicesAndAbonneZorkTestCase {
protected $_zowife, $_zork_boy, $_zork_girl;
public function setUp() {
parent::setUp();
$this->_zowife = Class_Users::newInstanceWithId(45,
['password' => 'zowife',
'login' => 'zork_sigb']);
$this->_zork_boy = Class_Users::newInstanceWithId(65,
['password' => 'zorkboy',
'login' => 'zork_sigb']);
$this->_zork_girl = Class_Users::newInstanceWithId(85,
['password' => 'zorkgirl',
'login' => 'zork_sigb']);
Class_Users
::whenCalled('save')
->with($this->_zork)
->answers(true)
->whenCalled('findAllBy')
->with(['login' => 'zork_sigb'])
->answers([$this->_zork,
$this->_zowife,
$this->_zork_boy,
$this->_zork_girl]);
$this->_adapter = (new ZendAfi_Auth_Adapter_CommSigb())
->setIdentity('zork_sigb')
->setCredential('secret');
$this->_authenticate_result = $this->_adapter->authenticate();
}
/** @test **/
public function onlyZorkShouldHaveBeenSave() {
$this->assertTrue(Class_Users::methodHasBeenCalled('save'));
}
}
class AuthCommSigbAuthenticationSetupInvalidUserTest extends AuthCommSigbWithWebServicesAndAbonneZorkTestCase {
public function setUp() {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment