mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-01-10 06:27:24 +01:00
40 lines
953 B
PHP
40 lines
953 B
PHP
<?php
|
|
|
|
namespace Tests\Unit\Attribut;
|
|
|
|
use Infinito\Attribut\RequestAttribut;
|
|
use Infinito\Attribut\RequestAttributInterface;
|
|
use PHPUnit\Framework\TestCase;
|
|
use Symfony\Component\HttpFoundation\Request;
|
|
|
|
/**
|
|
* @author kevinfrantz
|
|
*/
|
|
class RequestAttributTest extends TestCase
|
|
{
|
|
/**
|
|
* @var RequestAttributInterface
|
|
*/
|
|
protected $requestAttribut;
|
|
|
|
public function setUp(): void
|
|
{
|
|
$this->requestAttribut = new class() implements RequestAttributInterface {
|
|
use RequestAttribut;
|
|
};
|
|
}
|
|
|
|
public function testConstruct(): void
|
|
{
|
|
$this->expectException(\TypeError::class);
|
|
$this->requestAttribut->getRequest();
|
|
}
|
|
|
|
public function testAccessors(): void
|
|
{
|
|
$request = $this->createMock(Request::class);
|
|
$this->assertNull($this->requestAttribut->setRequest($request));
|
|
$this->assertEquals($request, $this->requestAttribut->getRequest());
|
|
}
|
|
}
|