-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathUpdateVideoTitleCommandMother.php
More file actions
34 lines (29 loc) · 1.02 KB
/
UpdateVideoTitleCommandMother.php
File metadata and controls
34 lines (29 loc) · 1.02 KB
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
<?php
namespace CodelyTv\Tests\Mooc\Videos\Application\Update;
use CodelyTv\Mooc\Videos\Application\Update\UpdateVideoTitleCommand;
use CodelyTv\Mooc\Videos\Domain\VideoId;
use CodelyTv\Mooc\Videos\Domain\VideoTitle;
use CodelyTv\Tests\Mooc\Videos\Domain\VideoIdMother;
use CodelyTv\Tests\Mooc\Videos\Domain\VideoTitleMother;
use PHPUnit\Framework\TestCase;
class UpdateVideoTitleCommandMother extends TestCase
{
public static function create(
?VideoId $id = null,
?VideoTitle $title = null
): UpdateVideoTitleCommand
{
return new UpdateVideoTitleCommand(
$id->value() ?? VideoIdMother::create()->value(),
$title->value() ?? VideoTitleMother::create()->value()
);
}
public static function withId(VideoId $id): UpdateVideoTitleCommand
{
return self::create($id, VideoTitleMother::create());
}
public static function withIdAndTitle(VideoId $id, VideoTitle $title): UpdateVideoTitleCommand
{
return self::create($id, $title);
}
}