From 2ed83ab2846a5c39de9789b3372fc6b7d015e65f Mon Sep 17 00:00:00 2001 From: Kevin Frantz Date: Sun, 27 Jan 2019 16:24:57 +0100 Subject: [PATCH] Rised CodeCoverage of AbstractAction to 100% --- .../Read/AbstractActionTest.php | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 application/symfony/tests/Unit/Domain/ActionManagement/Read/AbstractActionTest.php diff --git a/application/symfony/tests/Unit/Domain/ActionManagement/Read/AbstractActionTest.php b/application/symfony/tests/Unit/Domain/ActionManagement/Read/AbstractActionTest.php new file mode 100644 index 0000000..5197920 --- /dev/null +++ b/application/symfony/tests/Unit/Domain/ActionManagement/Read/AbstractActionTest.php @@ -0,0 +1,57 @@ +actionService = $this->createMock(ActionServiceInterface::class); + $this->action = new class($this->actionService) extends AbstractAction { + public $isSecure; + public $validByForm; + + protected function isSecure(): bool + { + return $this->isSecure; + } + + protected function isValidByForm(): bool + { + return $this->validByForm; + } + + protected function proccess() + { + } + }; + } + + public function testNotValidByFormException(): void + { + $this->action->isSecure = true; + $this->action->validByForm = false; + $this->expectException(NotValidByFormException::class); + $this->action->execute(); + } +}