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

@@ -9,11 +9,14 @@ use Infinito\Domain\SourceManagement\SourceRightManager;
use Infinito\Entity\Meta\RightInterface;
use Infinito\Entity\Meta\Right;
use Infinito\Entity\Meta\Law;
use Infinito\Exception\AllreadySetException;
use Infinito\Exception\Collection\NotSetException;
use Infinito\Exception\AllreadyDefinedException;
use Infinito\Entity\Source\PureSource;
use Infinito\Exception\Collection\ContainsElementException;
use Infinito\Exception\Attribut\AllreadyDefinedAttributException;
use Infinito\Exception\Collection\NotSetElementException;
/**
* @author kevinfrantz
*/
class SourceRightManagerTest extends TestCase
{
/**
@@ -41,27 +44,27 @@ class SourceRightManagerTest extends TestCase
public function testLawException(): void
{
$this->right->setLaw(new Law());
$this->expectException(AllreadyDefinedException::class);
$this->expectException(AllreadyDefinedAttributException::class);
$this->sourceRightManager->addRight($this->right);
}
public function testSourceException(): void
{
$this->right->setSource(new PureSource());
$this->expectException(AllreadyDefinedException::class);
$this->expectException(AllreadyDefinedAttributException::class);
$this->sourceRightManager->addRight($this->right);
}
public function testNotSetException(): void
public function testNotSetElementException(): void
{
$this->expectException(NotSetException::class);
$this->expectException(NotSetElementException::class);
$this->sourceRightManager->removeRight($this->right);
}
public function testAllreadSetException(): void
{
$this->sourceRightManager->addRight($this->right);
$this->expectException(AllreadySetException::class);
$this->expectException(ContainsElementException::class);
$this->sourceRightManager->addRight($this->right);
}