Skip to content

Instantly share code, notes, and snippets.

@JavierCane
Created November 20, 2016 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JavierCane/69cdab8800250978a156f145715c7f9d to your computer and use it in GitHub Desktop.
Save JavierCane/69cdab8800250978a156f145715c7f9d to your computer and use it in GitHub Desktop.
<?php
namespace CodelyTv\Context\Meetup\Module\Video\Test\PhpUnit;
use CodelyTv\Context\Meetup\Module\Video\Domain\Video;
use CodelyTv\Context\Meetup\Module\Video\Domain\VideoRepository;
use CodelyTv\Context\Meetup\Test\PhpUnit\MeetupContextUnitTestCase;
use Mockery\MockInterface;
use function CodelyTv\Test\similarTo;
abstract class VideoModuleUnitTestCase extends MeetupContextUnitTestCase
{
private $repository;
/** @return VideoRepository|MockInterface */
protected function repository()
{
return $this->repository = $this->repository ?: $this->mock(VideoRepository::class);
}
protected function shouldSaveVideo(Video $video)
{
$this->repository()
->shouldReceive('save')
->with(similarTo($video))
->once()
->andReturn($video);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment