column = new KanbanColumn(); } #[\PHPUnit\Framework\Attributes\Group('module')] public function testDefault() : void { self::assertEquals(0, $this->column->id); self::assertEquals('', $this->column->name); self::assertEquals(0, $this->column->order); self::assertEquals(0, $this->column->board); self::assertEquals([], $this->column->getCards()); } #[\PHPUnit\Framework\Attributes\Group('module')] public function testCardInputOutput() : void { $this->column->addCard(new KanbanCard()); self::assertCount(1, $this->column->getCards()); } #[\PHPUnit\Framework\Attributes\Group('module')] public function testCardRemove() : void { $this->column->addCard(new KanbanCard()); self::assertCount(1, $this->column->getCards()); self::assertTrue($this->column->removeCard(0)); self::assertCount(0, $this->column->getCards()); self::assertFalse($this->column->removeCard(0)); } #[\PHPUnit\Framework\Attributes\Group('module')] public function testSerialize() : void { $this->column->name = 'Name'; $this->column->board = 2; $this->column->order = 3; $serialized = $this->column->jsonSerialize(); unset($serialized['createdBy']); unset($serialized['createdAt']); self::assertEquals( [ 'id' => 0, 'name' => 'Name', 'order' => 3, 'board' => 2, 'cards' => [], ], $serialized ); } }