Skip to content

Commit ab0eaa1

Browse files
author
Ivan Vasilkov
committed
Add more test coverage for getFirstAttributeByClass
1 parent d0bc49b commit ab0eaa1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

tests/SchemaTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Composite\Entity\Tests\TestStand\TesEntityWithAttribute;
99
use Composite\Entity\Tests\TestStand\TestAttribute;
1010
use Composite\Entity\Tests\TestStand\TestBackedIntEnum;
11+
use Composite\Entity\Tests\TestStand\TestEntity;
1112

1213
final class SchemaTest extends \PHPUnit\Framework\TestCase
1314
{
@@ -63,6 +64,12 @@ public function test_getAttribute(): void
6364
$this->assertEquals(2, $attribute->val);
6465
}
6566

67+
public function test_getAttributeEmpty(): void
68+
{
69+
$attribute = TestEntity::schema()->getFirstAttributeByClass(TestAttribute::class);
70+
$this->assertNull($attribute);
71+
}
72+
6673
public function test_getColumn(): void
6774
{
6875
$column = TesEntityWithAttribute::schema()->getColumn('not_existing');

0 commit comments

Comments
 (0)