Skip to content

Instantly share code, notes, and snippets.

View jsdecena's full-sized avatar
👑
Focusing

Jeff Decena jsdecena

👑
Focusing
View GitHub Profile
@jsdecena
jsdecena / CarouselRepository.php
Created March 8, 2018 00:27
Carousel Repository Class
<?php
namespace App\Shop\Carousels\Repositories;
use App\Shop\Carousels\Carousel;
use App\Shop\Carousels\Exceptions\CarouselNotFoundException;
use App\Shop\Carousels\Exceptions\CreateCarouselErrorException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\QueryException;
@jsdecena
jsdecena / CarouselUnitTest.php
Created March 8, 2018 00:30
Carousel Unit Test File
<?php
namespace Tests\Unit\Carousels;
use Tests\TestCase;
class CarouselUnitTest extends TestCase
{
/** @test */
public function it_can_update_the_carousel()
@jsdecena
jsdecena / CarouselRepository.php
Created March 8, 2018 00:32
Carousel Repository Class
<?php
namespace App\Shop\Carousels\Repositories;
use App\Shop\Carousels\Carousel;
use App\Shop\Carousels\Exceptions\CarouselNotFoundException;
use App\Shop\Carousels\Exceptions\CreateCarouselErrorException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\QueryException;
@jsdecena
jsdecena / CarouselUnitTest.php
Created March 8, 2018 00:33
Carousel Unit Test Class
<?php
namespace Tests\Unit\Carousels;
use Tests\TestCase;
class CarouselUnitTest extends TestCase
{
/** @test */
public function it_can_delete_the_carousel()
@jsdecena
jsdecena / CarouselRepository.php
Created March 8, 2018 00:35
Carousel Repository Class
<?php
namespace App\Shop\Carousels\Repositories;
use App\Shop\Carousels\Carousel;
use App\Shop\Carousels\Exceptions\CarouselNotFoundException;
use App\Shop\Carousels\Exceptions\CreateCarouselErrorException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\QueryException;
@jsdecena
jsdecena / CarouselUnitTest.php
Created March 8, 2018 00:53
Carousel Unit Test File
<?php
namespace Tests\Unit\Carousels;
use Tests\TestCase;
class CarouselUnitTest extends TestCase
{
/** @test */
public function it_should_throw_an_error_when_the_required_columns_are_not_filled()
@jsdecena
jsdecena / CreateCarouselErrorException.php
Created March 8, 2018 00:57
Create Carousel Error Exception Class
<?php
namespace App\Shop\Carousels\Exceptions;
class CreateCarouselErrorException extends \Exception
{
}
@jsdecena
jsdecena / CarouselUnitTest.php
Created March 8, 2018 00:59
Carousel Unit Test File
<?php
namespace Tests\Unit\Carousels;
use Tests\TestCase;
class CarouselUnitTest extends TestCase
{
/** @test */
public function it_should_throw_not_found_error_exception_when_the_carousel_is_not_found()
@jsdecena
jsdecena / CarouselRepository.php
Created March 8, 2018 01:04
Carousel Repository Find Carousel Method
<?php
namespace App\Shop\Carousels\Repositories;
use App\Shop\Carousels\Carousel;
use App\Shop\Carousels\Exceptions\CarouselNotFoundException;
use App\Shop\Carousels\Exceptions\CreateCarouselErrorException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\QueryException;
@jsdecena
jsdecena / CarouselUnitTest.php
Created March 8, 2018 01:06
Carousel Unit Test File
<?php
namespace Tests\Unit\Carousels;
use Tests\TestCase;
class CarouselUnitTest extends TestCase
{
/** @test */
public function it_should_throw_update_error_exception_when_the_carousel_has_failed_to_update()