Finished refactoring of exceptions

This commit is contained in:
Kevin Frantz
2019-04-15 01:37:17 +02:00
parent 9f179ead73
commit 06f69675ac
49 changed files with 159 additions and 135 deletions

View File

@@ -7,7 +7,7 @@ use Infinito\Domain\ActionManagement\ActionInterface;
use Infinito\Domain\ActionManagement\AbstractAction;
use Infinito\Domain\ActionManagement\ActionDependenciesDAOServiceInterface;
use PHPUnit\Framework\MockObject\MockObject;
use Infinito\Exception\NotValidByFormException;
use Infinito\Exception\Validation\FormInvalidException;
/**
* @author kevinfrantz
@@ -51,7 +51,7 @@ class AbstractActionTest extends TestCase
{
$this->action->isSecure = true;
$this->action->validByForm = false;
$this->expectException(NotValidByFormException::class);
$this->expectException(FormInvalidException::class);
$this->action->execute();
}
}

View File

@@ -7,10 +7,10 @@ use PHPUnit\Framework\TestCase;
use Infinito\Domain\ActionManagement\Read\ReadAction;
use Infinito\Domain\ActionManagement\ActionDependenciesDAOServiceInterface;
use Infinito\Domain\ActionManagement\Read\ReadActionInterface;
use Infinito\Exception\NotSecureException;
use Infinito\Domain\RequestManagement\Action\RequestedActionInterface;
use Infinito\Domain\RequestManagement\Entity\RequestedEntityInterface;
use Infinito\Entity\Source\SourceInterface;
use Infinito\Exception\Permission\NoPermissionException;
/**
* @author kevinfrantz
@@ -59,7 +59,7 @@ class ReadSourceActionTest extends TestCase
public function testNotSecureException(): void
{
$this->actionService->method('isRequestedActionSecure')->willReturn(false);
$this->expectException(NotSecureException::class);
$this->expectException(NoPermissionException::class);
$this->sourceReadAction->execute();
}