mirror of
https://github.com/kevinveenbirkenbach/infinito.git
synced 2025-09-13 05:47:11 +02:00
Implemented RequestAttribut
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Attribut;
|
||||
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use App\Attribut\RequestAttributInterface;
|
||||
use App\Attribut\RequestAttribut;
|
||||
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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user