Skip to content

Commit deeded5

Browse files
committed
feat(legacy-create-video): [golden-master] 🔴 add failing unit test
1 parent 1f42583 commit deeded5

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

exercises/legacy_create_video/solutions/codely_php-symfony_golden-master/src/AppBundle/Repository/MySqlVideoRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use Doctrine\DBAL\Connection;
88

9-
final class MySqlVideoRepository
9+
class MySqlVideoRepository
1010
{
1111
/**
1212
* @var Connection
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace AppBundle\Tests\Application;
6+
7+
use AppBundle\Application\VideoCreator;
8+
use AppBundle\Repository\MySqlVideoRepository;
9+
use PHPUnit\Framework\TestCase;
10+
11+
final class VideoCreatorTest extends TestCase
12+
{
13+
/** @test */
14+
public function itShouldTransformFrontEndWord(): void
15+
{
16+
$repository = $this->createMock(MySqlVideoRepository::class);
17+
$videoCreator = new VideoCreator($repository);
18+
19+
list($title) = $videoCreator->createVideo("Testing frontend", "url", 3);
20+
21+
$this->assertEquals("Testing Front-end", $title);
22+
}
23+
}

0 commit comments

Comments
 (0)