Last active
March 5, 2019 08:30
-
-
Save jsdecena/c73184fd5fd1457cf4951921f8559cd1 to your computer and use it in GitHub Desktop.
Carousel Unit Test File
This file contains hidden or 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 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
image_src
should be justsrc
in your last assertion init_can_create_a_carousel()