From 49149ab1c1c9f522fc7661d10d7e60252cb2f733 Mon Sep 17 00:00:00 2001 From: "dorian.hodin" Date: Sun, 19 Mar 2023 12:34:27 +0100 Subject: [PATCH] Almost every test are here, still Model Test missing, many tests don't work cause of API is not deploy anymore --- Source/Config/config.php | 1 + Source/Controller/FrontController.php | 37 ++- .../InvalidUsernameOrPasswordException.php | 2 +- Source/Tests/TestController/.gitkeep | 0 .../TestController/ControllerAdminTest.php | 100 ++++++ .../ControllerCandidateTest.php | 104 ++++++ .../TestController/FrontControllerTest.php | 35 ++ .../InexistantLoginExceptionTest.php | 18 + .../InvalidLoginOrPasswordExceptionTest.php | 18 + ...InvalidUsernameOrPasswordExceptionTest.php | 20 ++ Source/Tests/coverage.xml | 314 ++++++++++++++---- Source/Views/HTML/error.php | 12 +- 12 files changed, 590 insertions(+), 71 deletions(-) delete mode 100644 Source/Tests/TestController/.gitkeep create mode 100644 Source/Tests/TestController/ControllerAdminTest.php create mode 100644 Source/Tests/TestController/ControllerCandidateTest.php create mode 100644 Source/Tests/TestController/FrontControllerTest.php create mode 100644 Source/Tests/TestException/InexistantLoginExceptionTest.php create mode 100644 Source/Tests/TestException/InvalidLoginOrPasswordExceptionTest.php create mode 100644 Source/Tests/TestException/InvalidUsernameOrPasswordExceptionTest.php diff --git a/Source/Config/config.php b/Source/Config/config.php index 25eebd7..1024d98 100644 --- a/Source/Config/config.php +++ b/Source/Config/config.php @@ -11,6 +11,7 @@ $views['categories'] = 'Views/HTML/categories.php'; $views['questions'] = 'Views/HTML/questions.php'; $views['responses'] = 'Views/HTML/responses.php'; $views['thanks'] = 'Views/HTML/thanks.php'; +$views['error']='Views/HTML/error.php'; $_SERVER['BASE_URI'] = ''; diff --git a/Source/Controller/FrontController.php b/Source/Controller/FrontController.php index ebb37d0..3d3c80c 100644 --- a/Source/Controller/FrontController.php +++ b/Source/Controller/FrontController.php @@ -3,8 +3,6 @@ namespace Controller; use Exception; -use PDOException; -use Config\Validate; use Config\Clean; use Config\AltoRouter; @@ -13,9 +11,12 @@ use Config\AltoRouter; */ class FrontController { - private $router; - private $rights; - + private AltoRouter $router; + private array $rights; + + /** + * @throws Exception + */ public function __construct() { $this->router = new AltoRouter(); $this->router->setBasePath($_SERVER['BASE_URI']); @@ -26,7 +27,23 @@ class FrontController { ); } - public function run() { + /** + * @return array + */ + public function getRights(): array + { + return $this->rights; + } + + /** + * @return AltoRouter + */ + public function getRouter(): AltoRouter + { + return $this->router; + } + public function run(): void + { global $error,$rep,$views; $exists=false; $match = $this->router->match(); @@ -56,7 +73,11 @@ class FrontController { } } - private function mapRoutes() { + /** + * @throws Exception + */ + protected function mapRoutes(): void + { global $controller; $this->router->map('GET', '/', array($controller['Candidate'], 'goToForm'), 'goToForm'); $this->router->map('POST', '/submitForm', array($controller['Candidate'], 'submitForm'), 'submitForm'); @@ -73,4 +94,4 @@ class FrontController { $this->router->map('GET','/goToQuestions',array($controller['Admin'],'goToQuestions'),'goToQuestions'); $this->router->map('GET','/goToResponses',array($controller['Admin'],'goToResponses'),'goToResponses'); } -} +} \ No newline at end of file diff --git a/Source/Exceptions/InvalidUsernameOrPasswordException.php b/Source/Exceptions/InvalidUsernameOrPasswordException.php index d536f7e..8e89b8d 100644 --- a/Source/Exceptions/InvalidUsernameOrPasswordException.php +++ b/Source/Exceptions/InvalidUsernameOrPasswordException.php @@ -6,7 +6,7 @@ use Exception; class InvalidUsernameOrPasswordException extends Exception { - public function __construct($message = "nom d'utilisateur ou mot de passe invalide", $code = 0, Exception $previous = null) + public function __construct($message = "Nom d'utilisateur ou mot de passe invalide", $code = 0, Exception $previous = null) { parent::__construct($message, $code, $previous); } diff --git a/Source/Tests/TestController/.gitkeep b/Source/Tests/TestController/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/Source/Tests/TestController/ControllerAdminTest.php b/Source/Tests/TestController/ControllerAdminTest.php new file mode 100644 index 0000000..2346825 --- /dev/null +++ b/Source/Tests/TestController/ControllerAdminTest.php @@ -0,0 +1,100 @@ +expectException(InvalidArgumentException::class); + $controller->addQuestion(); + } + + /** + * @throws Exception + * @throws \Exception + */ + public function testAddQuestionCallsModelAdminAndGoesToQuestionsWhenTypeIsTextQuestion() + { + $modelMock = $this->createMock(ModelAdmin::class); + $modelMock->expects($this->once())->method('addQuestion'); + $controller = new ControllerAdmin(); + $controller->goToQuestions = $this->createMock(stdClass::class); // mock the method + $_POST['type'] = 'BusinessClass\TextQuestion'; + $controller->addQuestion(); + } + + /** + * @throws Exception + * @throws \Exception + */ + public function testAddQuestionCallsModelAdminAndRequiresPossibleResponsesFormWhenTypeIsNotTextQuestion() + { + $modelMock = $this->createMock(ModelAdmin::class); + $modelMock->expects($this->once())->method('addQuestion'); + $modelMock->expects($this->once())->method('getCategories'); + $controller = new ControllerAdmin(); + $controller->goToQuestions = $this->createMock(stdClass::class); // mock the method + $_POST['type'] = 'BusinessClass\OtherQuestion'; + $GLOBALS['rep'] = 'path/to/'; + $GLOBALS['views'] = ['possibleResponsesForm' => 'path/to/possibleResponsesForm.php']; + $this->expectOutputString(file_get_contents('path/to/possibleResponsesForm.php')); + $controller->addQuestion(); + } + + /** + * @throws \Exception + */ + public function testAddResponseThrowsExceptionWhenParametersAreMissing() + { + $controller = new ControllerAdmin(); + $_POST = []; + $this->expectException(InvalidArgumentException::class); + $controller->addResponse(); + } + + /** + * @throws Exception + * @throws \Exception + */ + public function testAddResponseCallsModelAdminAndRequiresContinueWhenParametersAreValid() + { + $modelMock = $this->createMock(ModelAdmin::class); + $modelMock->expects($this->once())->method('addResponse'); + $modelMock->expects($this->once())->method('getCategories'); + $controller = new ControllerAdmin(); + $GLOBALS['rep'] = 'path/to/'; + $GLOBALS['views'] = ['continue' => 'path/to/continue.php']; + $_POST['idQuestion'] = '123'; + $_POST['question'] = 'What is the meaning of life?'; + $_POST['type'] = 'BusinessClass\OtherQuestion'; + $this->expectOutputString(file_get_contents('path/to/continue.php')); + $controller->addResponse(); + } + + /** + * @throws \Exception + */ + public function testContinueResponseThrowsExceptionWhenParametersAreMissing() + { + $controller = new ControllerAdmin(); + $_POST = []; + $this->expectException(InvalidArgumentException::class); + $controller->continueResponse(); + + } +} + diff --git a/Source/Tests/TestController/ControllerCandidateTest.php b/Source/Tests/TestController/ControllerCandidateTest.php new file mode 100644 index 0000000..3dd6f76 --- /dev/null +++ b/Source/Tests/TestController/ControllerCandidateTest.php @@ -0,0 +1,104 @@ +controller = new ControllerCandidate(); + } + + /** + * @throws \PHPUnit\Framework\MockObject\Exception + * @throws Exception + */ + public function testGoToForm(): void + { + $modelMock = $this->createMock(ModelCandidate::class); + $modelMock->expects($this->once()) + ->method('getForm') + ->willReturn('
'); + $this->controller->goToForm(); + $this->expectOutputRegex('/
.*<\/form>/s'); + } + + public function testGoToAdminLogin(): void + { + global $rep, $views; + $this->controller->goToAdminLogin(); + $this->expectOutputString(file_get_contents($rep . $views['adminLogin'])); + } + + /** + * @throws \PHPUnit\Framework\MockObject\Exception + * @throws Exception + */ + public function testSubmitForm(): void + { + $modelMock = $this->createMock(ModelCandidate::class); + $modelMock->expects($this->once()) + ->method('submitForm'); + $this->controller->submitForm(); + $this->expectOutputRegex('/' . preg_quote('Location: ?thanks', '/') . '/'); + } + + public function testGoToThanks(): void + { + global $rep, $views; + $this->controller->goToThanks(); + $this->expectOutputString(file_get_contents($rep . $views['thanks'])); + } + + /** + * @throws \PHPUnit\Framework\MockObject\Exception + */ + public function testLoginAsAdmin(): void + { + global $rep, $views; + $_SESSION['role'] = 'Admin'; + $modelMock = $this->createMock(ModelCandidate::class); + $modelMock->expects($this->once()) + ->method('login'); + $this->controller->login(); + $this->expectOutputString(file_get_contents($rep . $views['admin'])); + } + + /** + * @throws \PHPUnit\Framework\MockObject\Exception + */ + public function testLoginAsNonAdmin(): void + { + global $rep, $views; + $_SESSION['role'] = 'NonAdmin'; + $modelMock = $this->createMock(ModelCandidate::class); + $modelMock->expects($this->once()) + ->method('login'); + $this->controller->login(); + $this->expectOutputString(file_get_contents($rep . $views['adminLogin'])); + } + + /** + * @throws \PHPUnit\Framework\MockObject\Exception + */ + public function testLoginWithException(): void + { + global $rep, $views; + $_SESSION['role'] = 'NonAdmin'; + $modelMock = $this->createMock(ModelCandidate::class); + $modelMock->expects($this->once()) + ->method('login') + ->willThrowException(new Exception('Invalid credentials')); + $this->controller->login(); + $this->expectOutputString(file_get_contents($rep . $views['adminLogin'])); + } +} diff --git a/Source/Tests/TestController/FrontControllerTest.php b/Source/Tests/TestController/FrontControllerTest.php new file mode 100644 index 0000000..bed9bd1 --- /dev/null +++ b/Source/Tests/TestController/FrontControllerTest.php @@ -0,0 +1,35 @@ +frontController = new FrontController(); + } + + public function testRouterInstance(): void + { + $this->assertInstanceOf('\Config\AltoRouter', $this->frontController->getRouter()); + } + + public function testRightsInstance(): void + { + $this->assertIsArray($this->frontController->getRights()); + } + + public function testRunMethod(): void + { + $this->expectOutputString(''); + $_SERVER['BASE_URI'] = '/'; + $_SESSION['role'] = 'Candidate'; + $this->frontController->run(); + } +} diff --git a/Source/Tests/TestException/InexistantLoginExceptionTest.php b/Source/Tests/TestException/InexistantLoginExceptionTest.php new file mode 100644 index 0000000..0d80345 --- /dev/null +++ b/Source/Tests/TestException/InexistantLoginExceptionTest.php @@ -0,0 +1,18 @@ +assertInstanceOf(InexistantLoginException::class, $exception); + $this->assertInstanceOf(Exception::class, $exception); + $this->assertEquals("Identifiant inexistant", $exception->getMessage()); + } +} diff --git a/Source/Tests/TestException/InvalidLoginOrPasswordExceptionTest.php b/Source/Tests/TestException/InvalidLoginOrPasswordExceptionTest.php new file mode 100644 index 0000000..3b81b79 --- /dev/null +++ b/Source/Tests/TestException/InvalidLoginOrPasswordExceptionTest.php @@ -0,0 +1,18 @@ +assertInstanceOf(InvalidLoginOrPasswordException::class, $exception); + $this->assertInstanceOf(Exception::class, $exception); + $this->assertEquals("Identifiant ou mot de passe invalide", $exception->getMessage()); + } +} diff --git a/Source/Tests/TestException/InvalidUsernameOrPasswordExceptionTest.php b/Source/Tests/TestException/InvalidUsernameOrPasswordExceptionTest.php new file mode 100644 index 0000000..b6b2223 --- /dev/null +++ b/Source/Tests/TestException/InvalidUsernameOrPasswordExceptionTest.php @@ -0,0 +1,20 @@ +assertInstanceOf(InvalidUsernameOrPasswordException::class, $exception); + $this->assertInstanceOf(Exception::class, $exception); + $this->assertEquals("Nom d'utilisateur ou mot de passe invalide", $exception->getMessage()); + } +} \ No newline at end of file diff --git a/Source/Tests/coverage.xml b/Source/Tests/coverage.xml index 8dde3d9..f8f3d69 100644 --- a/Source/Tests/coverage.xml +++ b/Source/Tests/coverage.xml @@ -1,65 +1,259 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TestController\ControllerAdminTest::testAddQuestionCallsModelAdminAndGoesToQuestionsWhenTypeIsTextQuestion +TypeError: BusinessClass\Question::__construct(): Argument #2 ($content) must be of type string, null given, called in F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php on line 47 + +F:\Documents\SAE4.01_FORMULAIRE\Source\BusinessClass\Question.php:25 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:29 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerAdminTest.php:37 + + + TestController\ControllerAdminTest::testAddQuestionCallsModelAdminAndRequiresPossibleResponsesFormWhenTypeIsNotTextQuestion +Error: Class "BusinessClass\OtherQuestion" not found + +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:29 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerAdminTest.php:55 + + + TestController\ControllerAdminTest::testAddResponseThrowsExceptionWhenParametersAreMissing +Failed asserting that exception of type "Exception" matches expected exception "InvalidArgumentException". Message was: "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/insertResponseInQuestion?%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20response=&%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20categories=Array&%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20$idQuestion=" at +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:28 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:48 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php:35 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php:71 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:63 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\HandlerStack.php:75 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:331 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:168 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:187 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php:84 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:53 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerAdminTest.php:66 +. + + + TestController\ControllerAdminTest::testAddResponseCallsModelAdminAndRequiresContinueWhenParametersAreValid +Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/insertResponseInQuestion?%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20response=&%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20categories=Array&%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20$idQuestion=123 + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:28 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:48 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php:35 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php:71 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:63 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\HandlerStack.php:75 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:331 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:168 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:187 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php:84 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:53 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerAdminTest.php:85 + + + TestController\ControllerAdminTest::testContinueResponseThrowsExceptionWhenParametersAreMissing +Failed asserting that exception of type "Exception" matches expected exception "InvalidArgumentException". Message was: "cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/existsForm" at +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:28 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:48 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php:35 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php:71 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:63 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\HandlerStack.php:75 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:331 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:168 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:187 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelAdmin.php:167 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:136 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerAdmin.php:84 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerAdminTest.php:96 +. + + + + + TestController\ControllerCandidateTest::testGoToForm +Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getForm + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:28 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:48 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php:35 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php:71 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:63 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\HandlerStack.php:75 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:331 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:168 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:187 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php:88 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:23 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:31 + + + TestController\ControllerCandidateTest::testGoToAdminLogin +Error: Failed opening required 'path/to/' (include_path='.;C:\php\pear') + +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:38 + + + TestController\ControllerCandidateTest::testSubmitForm +Exception: cURL error 60: SSL certificate problem: unable to get local issuer certificate (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://codefirst.iut.uca.fr/containers/Temoignages-deploy_api_form/getForm + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:211 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:158 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlFactory.php:110 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\CurlHandler.php:47 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:28 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Handler\Proxy.php:48 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\PrepareBodyMiddleware.php:35 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:31 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\RedirectMiddleware.php:71 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Middleware.php:63 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\HandlerStack.php:75 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:331 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:168 +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\vendor\guzzlehttp\guzzle\src\Client.php:187 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php:62 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:42 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:51 + + + TestController\ControllerCandidateTest::testGoToThanks +Error: Failed opening required 'path/to/' (include_path='.;C:\php\pear') + +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:49 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:58 + + + TestController\ControllerCandidateTest::testLoginAsAdmin +TypeError: Config\Clean::simpleString(): Argument #1 ($string) must be of type string, null given, called in F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php on line 154 + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\Clean.php:16 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php:154 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:55 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:72 + + + TestController\ControllerCandidateTest::testLoginAsNonAdmin +TypeError: Config\Clean::simpleString(): Argument #1 ($string) must be of type string, null given, called in F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php on line 154 + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\Clean.php:16 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php:154 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:55 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:86 + + + TestController\ControllerCandidateTest::testLoginWithException +TypeError: Config\Clean::simpleString(): Argument #1 ($string) must be of type string, null given, called in F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php on line 154 + +F:\Documents\SAE4.01_FORMULAIRE\Source\Config\Clean.php:16 +F:\Documents\SAE4.01_FORMULAIRE\Source\Model\ModelCandidate.php:154 +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\ControllerCandidate.php:55 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\ControllerCandidateTest.php:101 + + + + + + + TestController\FrontControllerTest::testRunMethod +Error: Failed opening required 'path/to/' (include_path='.;C:\php\pear') + +F:\Documents\SAE4.01_FORMULAIRE\Source\Controller\FrontController.php:67 +F:\Documents\SAE4.01_FORMULAIRE\Source\Tests\TestController\FrontControllerTest.php:33 + + + + + + + + + + diff --git a/Source/Views/HTML/error.php b/Source/Views/HTML/error.php index 1e8f37f..51350c9 100644 --- a/Source/Views/HTML/error.php +++ b/Source/Views/HTML/error.php @@ -1,9 +1,17 @@ - + + Error Page -

+

+ +

\ No newline at end of file