Refactored reciever

This commit is contained in:
Kevin Frantz
2018-12-14 10:10:28 +01:00
parent 33b1151a00
commit 0aac336609
11 changed files with 60 additions and 127 deletions

View File

@@ -5,7 +5,7 @@ namespace Tests\Unit\Entity\Attribut;
use PHPUnit\Framework\TestCase;
use App\Entity\Attribut\RecieverAttributInterface;
use App\Entity\Attribut\RecieverAttribut;
use App\Entity\Meta\RecieverInterface;
use App\Entity\Source\AbstractSource;
class RecieverAttributTest extends TestCase
{
@@ -29,7 +29,7 @@ class RecieverAttributTest extends TestCase
public function testAccessors(): void
{
$reciever = $this->createMock(RecieverInterface::class);
$reciever = $this->createMock(AbstractSource::class);
$this->assertNull($this->reciever->setReciever($reciever));
$this->assertEquals($reciever, $this->reciever->getReciever());
}

View File

@@ -1,28 +0,0 @@
<?php
namespace App\Tests\Unit\Entity\Meta;
use PHPUnit\Framework\TestCase;
use App\Entity\Meta\Reciever;
use App\Entity\Meta\RecieverInterface;
use Doctrine\Common\Collections\Collection;
class RecieverTest extends TestCase
{
/**
* @var RecieverInterface
*/
public $reciever;
public function setUp(): void
{
$this->reciever = new Reciever();
}
public function testConstructor(): void
{
$this->assertInstanceOf(Collection::class, $this->reciever->getCollection());
$this->expectException(\TypeError::class);
$this->reciever->getRight();
}
}

View File

@@ -27,11 +27,16 @@ class RightTest extends TestCase
public function testConstructorGeneral(): void
{
$this->assertEquals($this->right, $this->right->getReciever()->getRight());
$this->assertTrue($this->right->getGrant());
$this->assertEquals(0, $this->right->getPriority());
}
public function testConstructorReciever(): void
{
$this->expectException(\TypeError::class);
$this->right->getReciever();
}
public function testConstructorLayer(): void
{
$this->expectException(\TypeError::class);