mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-09 22:17:26 +01:00
Implemeted test for clone function
This commit is contained in:
parent
0c66e7a42a
commit
6a27c221a8
@ -9,6 +9,7 @@ use App\Entity\Meta\Right;
|
|||||||
use App\Entity\Meta\Law;
|
use App\Entity\Meta\Law;
|
||||||
use App\DBAL\Types\LayerType;
|
use App\DBAL\Types\LayerType;
|
||||||
use App\Exception\NoValidChoice;
|
use App\Exception\NoValidChoice;
|
||||||
|
use App\Entity\Source\AbstractSource;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @todo Implement reciever test
|
* @todo Implement reciever test
|
||||||
@ -89,4 +90,27 @@ class RightTest extends TestCase
|
|||||||
$this->expectException(NoValidChoice::class);
|
$this->expectException(NoValidChoice::class);
|
||||||
$this->right->setLayer('NoneValidLayer');
|
$this->right->setLayer('NoneValidLayer');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Just to test if the clone function works like assumed.
|
||||||
|
*/
|
||||||
|
public function testClone(): void
|
||||||
|
{
|
||||||
|
$source = $this->createMock(AbstractSource::class);
|
||||||
|
$reciever = $this->createMock(AbstractSource::class);
|
||||||
|
$grant = false;
|
||||||
|
$type = RightType::READ;
|
||||||
|
$layer = LayerType::SOURCE;
|
||||||
|
$this->right->setSource($source);
|
||||||
|
$this->right->setReciever($reciever);
|
||||||
|
$this->right->setGrant($grant);
|
||||||
|
$this->right->setType($type);
|
||||||
|
$this->right->setLayer($layer);
|
||||||
|
$rightClone = clone $this->right;
|
||||||
|
$this->assertEquals($source, $rightClone->getSource());
|
||||||
|
$this->assertEquals($reciever, $rightClone->getReciever());
|
||||||
|
$this->assertEquals($grant, $rightClone->getGrant());
|
||||||
|
$this->assertEquals($type, $rightClone->getType());
|
||||||
|
$this->assertEquals($layer, $rightClone->getLayer());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user