-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAttributesTest.php
36 lines (29 loc) · 1.35 KB
/
AttributesTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<?php
declare(strict_types=1);
namespace RustamWin\Attributes\Tests;
use PHPUnit\Framework\TestCase;
use RustamWin\Attributes\Attributes;
use RustamWin\Attributes\Handler\CompositeHandler;
use RustamWin\Attributes\Tests\Support\Entity\MockEntity;
use RustamWin\Attributes\Tests\Support\SimpleHandler;
final class AttributesTest extends TestCase
{
public function testHandle(): void
{
$this->assertContains('class', SimpleHandler::getValues());
$this->assertContains('const', SimpleHandler::getValues());
$this->assertContains('property', SimpleHandler::getValues());
$this->assertContains('method', SimpleHandler::getValues());
$this->assertContains('parameter', SimpleHandler::getValues());
}
public function testWithCompositePresenter(): void
{
$attributes = new Attributes(attributeHandler: new CompositeHandler([new SimpleHandler()]));
$attributes->setClasses([MockEntity::class])->setDirectories([__DIR__ . '/Support/Entity'])->handle();
$this->assertContains('class', SimpleHandler::getValues());
$this->assertContains('const', SimpleHandler::getValues());
$this->assertContains('property', SimpleHandler::getValues());
$this->assertContains('method', SimpleHandler::getValues());
$this->assertContains('parameter', SimpleHandler::getValues());
}
}