You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
SAE4.01_FORMULAIRE/Source/Tests/TestModel/testModelCandidat.php

58 lines
1.4 KiB

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