infinito/application/symfony/tests/Unit/Attribut/MemberRelationAttributTest.php

37 lines
1.0 KiB
PHP
Raw Permalink Normal View History

2018-11-26 21:41:06 +01:00
<?php
2019-01-20 10:41:58 +01:00
namespace Tests\Unit\Attribut;
2018-11-26 21:41:06 +01:00
use Infinito\Attribut\MemberRelationAttribut;
2020-04-02 21:13:35 +02:00
use Infinito\Attribut\MemberRelationAttributInterface;
use Infinito\Entity\Meta\Relation\Member\MemberRelationInterface;
2020-04-02 21:13:35 +02:00
use PHPUnit\Framework\TestCase;
2018-11-26 21:41:06 +01:00
class MemberRelationAttributTest extends TestCase
{
/**
* @var MemberRelationAttributInterface
*/
protected $memberRelation;
public function setUp(): void
{
$this->memberRelation = new class() implements MemberRelationAttributInterface {
use MemberRelationAttribut;
};
}
public function testConstructor(): void
{
$this->expectException(\TypeError::class);
$this->memberRelation->getMemberRelation();
}
public function testAccessors(): void
{
$membership = $this->createMock(MemberRelationInterface::class);
2018-11-26 22:30:08 +01:00
$this->assertNull($this->memberRelation->setMemberRelation($membership));
$this->assertEquals($this->memberRelation->getMemberRelation(), $membership);
2018-11-26 21:41:06 +01:00
}
}