mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 03:04:05 +00:00
147 - Upgrading Laravel and Deleting Some Code
This commit is contained in:
620
composer.lock
generated
620
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -56,7 +56,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function adding_a_valid_concert()
|
function adding_a_valid_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function subtitle_is_optional()
|
function subtitle_is_optional()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function additional_information_is_optional()
|
function additional_information_is_optional()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|
||||||
@@ -375,7 +375,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function poster_image_is_uploaded_if_included()
|
function poster_image_is_uploaded_if_included()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
Event::fake([ConcertAdded::class]);
|
Event::fake([ConcertAdded::class]);
|
||||||
Storage::fake('public');
|
Storage::fake('public');
|
||||||
@@ -447,7 +447,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function poster_image_is_optional()
|
function poster_image_is_optional()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ class AddConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function an_event_is_fired_when_a_concert_is_added()
|
function an_event_is_fired_when_a_concert_is_added()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
Event::fake([ConcertAdded::class]);
|
Event::fake([ConcertAdded::class]);
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ class EditConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function promoters_can_view_the_edit_form_for_their_own_unpublished_concerts()
|
function promoters_can_view_the_edit_form_for_their_own_unpublished_concerts()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$concert = factory(Concert::class)->create(['user_id' => $user->id]);
|
$concert = factory(Concert::class)->create(['user_id' => $user->id]);
|
||||||
@@ -120,7 +120,7 @@ class EditConcertTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function promoters_can_edit_their_own_unpublished_concerts()
|
function promoters_can_edit_their_own_unpublished_concerts()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$concert = factory(Concert::class)->create([
|
$concert = factory(Concert::class)->create([
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ class MessageAttendeesTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function a_promoter_can_view_the_message_form_for_their_own_concert()
|
function a_promoter_can_view_the_message_form_for_their_own_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$concert = ConcertFactory::createPublished([
|
$concert = ConcertFactory::createPublished([
|
||||||
@@ -57,7 +57,7 @@ class MessageAttendeesTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function a_promoter_can_send_a_new_message()
|
function a_promoter_can_send_a_new_message()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
Queue::fake();
|
Queue::fake();
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ class PromoterLoginTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function logging_in_with_valid_credentials()
|
function logging_in_with_valid_credentials()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create([
|
$user = factory(User::class)->create([
|
||||||
'email' => 'jane@example.com',
|
'email' => 'jane@example.com',
|
||||||
@@ -34,7 +34,7 @@ class PromoterLoginTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function logging_in_with_invalid_credentials()
|
function logging_in_with_invalid_credentials()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$user = factory(User::class)->create([
|
$user = factory(User::class)->create([
|
||||||
'email' => 'jane@example.com',
|
'email' => 'jane@example.com',
|
||||||
@@ -56,7 +56,7 @@ class PromoterLoginTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function logging_in_with_an_account_that_does_not_exist()
|
function logging_in_with_an_account_that_does_not_exist()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$response = $this->post('/login', [
|
$response = $this->post('/login', [
|
||||||
'email' => 'nobody@example.com',
|
'email' => 'nobody@example.com',
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class ViewConcertListTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function promoters_can_view_a_list_of_their_concerts()
|
function promoters_can_view_a_list_of_their_concerts()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$otherUser = factory(User::class)->create();
|
$otherUser = factory(User::class)->create();
|
||||||
$publishedConcertA = ConcertFactory::createPublished(['user_id' => $user->id]);
|
$publishedConcertA = ConcertFactory::createPublished(['user_id' => $user->id]);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class ViewPublishedConcertOrdersTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function a_promoter_can_view_the_orders_of_their_own_published_concert()
|
function a_promoter_can_view_the_orders_of_their_own_published_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
|
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
|
||||||
|
|
||||||
@@ -32,7 +32,7 @@ class ViewPublishedConcertOrdersTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function a_promoter_can_view_the_10_most_recent_orders_for_their_concert()
|
function a_promoter_can_view_the_10_most_recent_orders_for_their_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
$user = factory(User::class)->create();
|
$user = factory(User::class)->create();
|
||||||
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
|
$concert = ConcertFactory::createPublished(['user_id' => $user->id]);
|
||||||
$oldOrder = OrderFactory::createForConcert($concert, ['created_at' => Carbon::parse('11 days ago')]);
|
$oldOrder = OrderFactory::createForConcert($concert, ['created_at' => Carbon::parse('11 days ago')]);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class PurchaseTicketsTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function customer_can_purchase_tickets_to_a_published_concert()
|
function customer_can_purchase_tickets_to_a_published_concert()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
OrderConfirmationNumber::shouldReceive('generate')->andReturn('ORDERCONFIRMATION1234');
|
OrderConfirmationNumber::shouldReceive('generate')->andReturn('ORDERCONFIRMATION1234');
|
||||||
TicketCode::shouldReceive('generateFor')->andReturn('TICKETCODE1', 'TICKETCODE2', 'TICKETCODE3');
|
TicketCode::shouldReceive('generateFor')->andReturn('TICKETCODE1', 'TICKETCODE2', 'TICKETCODE3');
|
||||||
@@ -145,7 +145,7 @@ class PurchaseTicketsTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function cannot_purchase_tickets_another_customer_is_already_trying_to_purchase()
|
function cannot_purchase_tickets_another_customer_is_already_trying_to_purchase()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$concert = \ConcertFactory::createPublished(['ticket_price' => 1200, 'ticket_quantity' => 3]);
|
$concert = \ConcertFactory::createPublished(['ticket_price' => 1200, 'ticket_quantity' => 3]);
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ class ViewOrderTest extends TestCase
|
|||||||
/** @test */
|
/** @test */
|
||||||
function user_can_view_their_order_confirmation()
|
function user_can_view_their_order_confirmation()
|
||||||
{
|
{
|
||||||
$this->disableExceptionHandling();
|
$this->withoutExceptionHandling();
|
||||||
|
|
||||||
$concert = factory(Concert::class)->create([
|
$concert = factory(Concert::class)->create([
|
||||||
'title' => 'The Red Chord',
|
'title' => 'The Red Chord',
|
||||||
|
|||||||
@@ -28,10 +28,6 @@ abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
|
|||||||
return $this->original->getData()[$key];
|
return $this->original->getData()[$key];
|
||||||
});
|
});
|
||||||
|
|
||||||
TestResponse::macro('assertViewIs', function ($name) {
|
|
||||||
Assert::assertEquals($name, $this->original->name());
|
|
||||||
});
|
|
||||||
|
|
||||||
EloquentCollection::macro('assertContains', function ($value) {
|
EloquentCollection::macro('assertContains', function ($value) {
|
||||||
Assert::assertTrue($this->contains($value), "Failed asserting that the collection contains the specified 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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user