50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
// phpcs:disable PEAR.Commenting.FileComment,PEAR.Commenting.ClassComment
|
|
|
|
/**
|
|
* Board domain tests.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Tests\Domain;
|
|
|
|
use IronKanban\Domain\Board;
|
|
use IronKanban\Domain\Column;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Covers board serialization behavior.
|
|
*/
|
|
final class BoardTest extends TestCase
|
|
{
|
|
/**
|
|
* Ensure a board exposes its columns and metadata as arrays.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function testToArrayIncludesSerializedColumnsAndMeta(): void
|
|
{
|
|
$board = new Board(
|
|
'demo-project',
|
|
[
|
|
new Column('backlog', 'Backlog', 100),
|
|
new Column('done', 'Done', 200),
|
|
],
|
|
['wip_limit' => 3]
|
|
);
|
|
|
|
self::assertSame(
|
|
[
|
|
'project_id' => 'demo-project',
|
|
'columns' => [
|
|
['id' => 'backlog', 'label' => 'Backlog', 'order' => 100],
|
|
['id' => 'done', 'label' => 'Done', 'order' => 200],
|
|
],
|
|
'meta' => ['wip_limit' => 3],
|
|
],
|
|
$board->toArray()
|
|
);
|
|
}
|
|
}
|