mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 13:57:10 +02:00
Finished refactoring of exceptions
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user