-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
ModelFactoryTest.php
38 lines (33 loc) · 1.08 KB
/
ModelFactoryTest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
namespace Tienvx\Bundle\MbtBundle\Tests\Factory;
use PHPUnit\Framework\TestCase;
use Tienvx\Bundle\MbtBundle\Factory\ModelFactory;
use Tienvx\Bundle\MbtBundle\Model\Model\RevisionInterface;
/**
* @covers \Tienvx\Bundle\MbtBundle\Factory\ModelFactory
*
* @uses \Tienvx\Bundle\MbtBundle\Factory\Model\RevisionFactory
* @uses \Tienvx\Bundle\MbtBundle\Entity\Model
* @uses \Tienvx\Bundle\MbtBundle\Model\Model
* @uses \Tienvx\Bundle\MbtBundle\Model\Model\Revision
*/
class ModelFactoryTest extends TestCase
{
protected array $data;
protected function setUp(): void
{
$this->data = [
'label' => 'Custom label',
'tags' => 'custom,tags',
'places' => [],
'transitions' => [],
];
}
public function testCreateFromArray(): void
{
$model = ModelFactory::createFromArray($this->data);
$this->assertSame('Custom label', $model->getLabel());
$this->assertSame('custom,tags', $model->getTags());
$this->assertInstanceOf(RevisionInterface::class, $model->getActiveRevision());
}
}