-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathVideoRenamerCommandTest.php
More file actions
44 lines (32 loc) · 1.14 KB
/
VideoRenamerCommandTest.php
File metadata and controls
44 lines (32 loc) · 1.14 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
35
36
37
38
39
40
41
42
43
44
<?php
namespace CodelyTv\Tests\Mooc\Videos\Application\Update;
use CodelyTv\Mooc\Videos\Application\Find\VideoFinder;
use CodelyTv\Mooc\Videos\Domain\VideoNotFound;
use CodelyTv\Tests\Mooc\Videos\Domain\VideoIdMother;
use CodelyTv\Tests\Mooc\Videos\Domain\VideoMother;
use CodelyTv\Tests\Mooc\Videos\VideosModuleUnitTestCase;
class VideoRenamerCommandTest extends VideosModuleUnitTestCase
{
private VideoFinder|null $finder;
protected function setUp(): void
{
parent::setUp();
$this->finder = new VideoFinder($this->repository());
}
/** @test */
public function it_should_throw_an_exception_when_the_video_not_exist()
{
$this->expectException(VideoNotFound::class);
$id = VideoIdMother::create();
$this->shouldSearch($id, null);
$this->finder->__invoke($id);
}
/** @test */
public function it_should_find_an_existing_video(): void
{
$video = VideoMother::create();
$this->shouldSearch($video->id(), $video);
$videoFromRepository = $this->finder->__invoke($video->id());
$this->assertEquals($videoFromRepository, $video);
}
}