147 - Upgrading Laravel and Deleting Some Code

This commit is contained in:
Adam Wathan
2017-12-08 12:29:13 -05:00
parent c4d4b2995b
commit 6f4da445d2
10 changed files with 372 additions and 307 deletions

620
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -56,7 +56,7 @@ class AddConcertTest extends TestCase
/** @test */
function adding_a_valid_concert()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
@@ -125,7 +125,7 @@ class AddConcertTest extends TestCase
/** @test */
function subtitle_is_optional()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
@@ -145,7 +145,7 @@ class AddConcertTest extends TestCase
/** @test */
function additional_information_is_optional()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
@@ -375,7 +375,7 @@ class AddConcertTest extends TestCase
/** @test */
function poster_image_is_uploaded_if_included()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
Event::fake([ConcertAdded::class]);
Storage::fake('public');
@@ -447,7 +447,7 @@ class AddConcertTest extends TestCase
/** @test */
function poster_image_is_optional()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
@@ -467,7 +467,7 @@ class AddConcertTest extends TestCase
/** @test */
function an_event_is_fired_when_a_concert_is_added()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
Event::fake([ConcertAdded::class]);
$user = factory(User::class)->create();

View File

@@ -50,7 +50,7 @@ class EditConcertTest extends TestCase
/** @test */
function promoters_can_view_the_edit_form_for_their_own_unpublished_concerts()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$concert = factory(Concert::class)->create(['user_id' => $user->id]);
@@ -120,7 +120,7 @@ class EditConcertTest extends TestCase
/** @test */
function promoters_can_edit_their_own_unpublished_concerts()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$concert = factory(Concert::class)->create([

View File

@@ -17,7 +17,7 @@ class MessageAttendeesTest extends TestCase
/** @test */
function a_promoter_can_view_the_message_form_for_their_own_concert()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$concert = ConcertFactory::createPublished([
@@ -57,7 +57,7 @@ class MessageAttendeesTest extends TestCase
/** @test */
function a_promoter_can_send_a_new_message()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
Queue::fake();
$user = factory(User::class)->create();

View File

@@ -14,7 +14,7 @@ class PromoterLoginTest extends TestCase
/** @test */
function logging_in_with_valid_credentials()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create([
'email' => 'jane@example.com',
@@ -34,7 +34,7 @@ class PromoterLoginTest extends TestCase
/** @test */
function logging_in_with_invalid_credentials()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create([
'email' => 'jane@example.com',
@@ -56,7 +56,7 @@ class PromoterLoginTest extends TestCase
/** @test */
function logging_in_with_an_account_that_does_not_exist()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$response = $this->post('/login', [
'email' => 'nobody@example.com',

View File

@@ -29,7 +29,7 @@ class ViewConcertListTest extends TestCase
/** @test */
function promoters_can_view_a_list_of_their_concerts()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$otherUser = factory(User::class)->create();
$publishedConcertA = ConcertFactory::createPublished(['user_id' => $user->id]);

View File

@@ -18,7 +18,7 @@ class ViewPublishedConcertOrdersTest extends TestCase
/** @test */
function a_promoter_can_view_the_orders_of_their_own_published_concert()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
@@ -32,7 +32,7 @@ class ViewPublishedConcertOrdersTest extends TestCase
/** @test */
function a_promoter_can_view_the_10_most_recent_orders_for_their_concert()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$user = factory(User::class)->create();
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
$oldOrder = OrderFactory::createForConcert($concert, ['created_at' => Carbon::parse('11 days ago')]);

View File

@@ -55,7 +55,7 @@ class PurchaseTicketsTest extends TestCase
/** @test */
function customer_can_purchase_tickets_to_a_published_concert()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
OrderConfirmationNumber::shouldReceive('generate')->andReturn('ORDERCONFIRMATION1234');
TicketCode::shouldReceive('generateFor')->andReturn('TICKETCODE1', 'TICKETCODE2', 'TICKETCODE3');
@@ -145,7 +145,7 @@ class PurchaseTicketsTest extends TestCase
/** @test */
function cannot_purchase_tickets_another_customer_is_already_trying_to_purchase()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$concert = \ConcertFactory::createPublished(['ticket_price' => 1200, 'ticket_quantity' => 3]);

View File

@@ -16,7 +16,7 @@ class ViewOrderTest extends TestCase
/** @test */
function user_can_view_their_order_confirmation()
{
$this->disableExceptionHandling();
$this->withoutExceptionHandling();
$concert = factory(Concert::class)->create([
'title' => 'The Red Chord',

View File

@@ -28,10 +28,6 @@ abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
return $this->original->getData()[$key];
});
TestResponse::macro('assertViewIs', function ($name) {
Assert::assertEquals($name, $this->original->name());
});
EloquentCollection::macro('assertContains', function ($value) {
Assert::assertTrue($this->contains($value), "Failed asserting that the collection contains the specified value.");
});
@@ -49,21 +45,4 @@ abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
});
});
}
protected function disableExceptionHandling()
{
$this->app->instance(ExceptionHandler::class, new class extends Handler {
public function __construct() {}
public function report(Exception $e) {}
public function render($request, Exception $e) {
throw $e;
}
});
}
protected function from($url)
{
session()->setPreviousUrl(url($url));
return $this;
}
}