/
AleksWork
/
diary_plants
Обзор
Документация
Войти
/
AleksWork
/
diary_plants
Код
Пакеты
0
Релизы
0
Аналитика
Безопасность
develop
tests/Unit/Domain/ValueObject/Usage/AttachableReferenceTest.php
52 строки
2 KB
AlekseySerov
Fix some bugs in tests
09 апр 2026, 21:26
09 апр 2026, 21:26
a8e788d
Код
Авторство
О чём код?
<?php namespace Unit\Domain\ValueObject\Usage; use PHPUnit\Framework\TestCase; use App\Domain\ValueObject\Enum\Usage\AttachableType; use App\Domain\ValueObject\Usage\AttachableReference; class AttachableReferenceTest extends TestCase { public function testInitialization(): void { $id = 123; $type = AttachableType::FERTILIZER; $reference = new AttachableReference($id, $type); $this->assertEquals($id, $reference->getUsableId()); $this->assertSame($type, $reference->getUsableType()); } public function testIsMethodsReturnCorrectBoolean(): void { $reference = new AttachableReference(1, AttachableType::WATERING); $this->assertTrue($reference->isWatering()); $this->assertFalse($reference->isFertilizer()); $this->assertFalse($reference->isPest()); $this->assertFalse($reference->isStimulant()); } public function testPestIdentification(): void { $reference = new AttachableReference(1, AttachableType::PEST); $this->assertTrue($reference->isPest()); } public function testStimulantIdentification(): void { $reference = new AttachableReference(1, AttachableType::STIMULANT); $this->assertTrue($reference->isStimulant()); } public function testNullableInitialization(): void { $reference = new AttachableReference(null, null); $this->assertNull($reference->getUsableId()); $this->assertNull($reference->getUsableType()); $this->assertFalse($reference->isWatering()); } }