Created
March 8, 2018 00:19
-
-
Save jsdecena/3e1976ef88eca31b1127a4fddd882bdd to your computer and use it in GitHub Desktop.
Carousel Unit Test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Tests\Unit\Carousels; | |
use App\Shop\Carousels\Carousel; | |
use App\Shop\Carousels\Repositories\CarouselRepository; | |
use Tests\TestCase; | |
class CarouselUnitTest extends TestCase | |
{ | |
/** @test */ | |
public function it_can_create_a_carousel() | |
{ | |
$data = [ | |
'title' => $this->faker->word, | |
'link' => $this->faker->url, | |
'src' => $this->faker->url, | |
]; | |
$carouselRepo = new CarouselRepository(new Carousel); | |
$carousel = $carouselRepo->createCarousel($data); | |
$this->assertInstanceOf(Carousel::class, $carousel); | |
$this->assertEquals($data['title'], $carousel->title); | |
$this->assertEquals($data['link'], $carousel->link); | |
$this->assertEquals($data['image_src'], $carousel->src); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment