Add unitary tests for the modelAdmin class
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
80a95da97c
commit
d20cc43d9a
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
namespace TestModel;
|
||||
|
||||
use Exceptions\InexistantLoginException;
|
||||
use Exceptions\InvalidLoginOrPasswordException;
|
||||
use Model\ModelCandidate;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ModelCandidateTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testInvalideAllArgumentLogin() {
|
||||
$this->expectException(InvalidLoginOrPasswordException::class);
|
||||
|
||||
$_REQUEST['password'] = "";
|
||||
$_REQUEST['login'] = "";
|
||||
$model = new ModelCandidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testInvalidePasswordArgumentLogin() {
|
||||
$this->expectException(InvalidLoginOrPasswordException::class);
|
||||
|
||||
$_REQUEST['password'] = "admin";
|
||||
$_REQUEST['login'] = "aze";
|
||||
$model = new ModelCandidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testInvalideLoginArgumentLogin() {
|
||||
$this->expectException(InvalidLoginOrPasswordException::class);
|
||||
|
||||
$_REQUEST['password'] = "ad";
|
||||
$_REQUEST['login'] = "azertyuiop";
|
||||
$model = new ModelCandidate();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function testUndifineLoginArgumentLogin() {
|
||||
$this->expectException(InexistantLoginException::class);
|
||||
|
||||
$_REQUEST['password'] = "invalideAdmin";
|
||||
$_REQUEST['login'] = "azertyuiop";
|
||||
$model = new ModelCandidate();
|
||||
}
|
||||
}
|
Loading…
Reference in new issue