1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace EasySwoole\DoctrineAnnotation\Tests\Annotation;
- use EasySwoole\DoctrineAnnotation\Annotation\Target;
- use PHPUnit\Framework\TestCase;
- class TargetTest extends TestCase
- {
-
- public function testValidMixedTargets(): void
- {
- $target = new Target(['value' => ['ALL']]);
- self::assertEquals(Target::TARGET_ALL, $target->targets);
- $target = new Target(['value' => ['METHOD', 'METHOD']]);
- self::assertEquals(Target::TARGET_METHOD, $target->targets);
- self::assertNotEquals(Target::TARGET_PROPERTY, $target->targets);
- $target = new Target(['value' => ['PROPERTY', 'METHOD']]);
- self::assertEquals(Target::TARGET_METHOD | Target::TARGET_PROPERTY, $target->targets);
- }
- }
|