mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-26 03:04:05 +00:00
100 - Namespacing Our Test Suite
This commit is contained in:
@@ -29,9 +29,9 @@
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"classmap": [
|
||||
"tests"
|
||||
]
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-root-package-install": [
|
||||
|
||||
@@ -9,8 +9,12 @@
|
||||
processIsolation="false"
|
||||
stopOnFailure="false">
|
||||
<testsuites>
|
||||
<testsuite name="Application Test Suite">
|
||||
<directory suffix="Test.php">./tests</directory>
|
||||
<testsuite name="Feature Tests">
|
||||
<directory suffix="Test.php">./tests/Feature</directory>
|
||||
</testsuite>
|
||||
|
||||
<testsuite name="Unit Tests">
|
||||
<directory suffix="Test.php">./tests/Unit</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
<filter>
|
||||
|
||||
22
tests/CreatesApplication.php
Normal file
22
tests/CreatesApplication.php
Normal file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Illuminate\Contracts\Console\Kernel;
|
||||
|
||||
trait CreatesApplication
|
||||
{
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->make(Kernel::class)->bootstrap();
|
||||
|
||||
return $app;
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\User;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class PromoterLoginTest extends TestCase
|
||||
{
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Concert;
|
||||
use Tests\TestCase;
|
||||
use App\Facades\TicketCode;
|
||||
use App\Billing\PaymentGateway;
|
||||
use App\Billing\FakePaymentGateway;
|
||||
use App\Mail\OrderConfirmationEmail;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use App\Facades\OrderConfirmationNumber;
|
||||
use App\OrderConfirmationNumberGenerator;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class PurchaseTicketsTest extends TestCase
|
||||
{
|
||||
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ViewConcertListingTest extends TestCase
|
||||
{
|
||||
@@ -1,12 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Feature;
|
||||
|
||||
use App\Order;
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Tests\TestCase;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ViewOrderTest extends TestCase
|
||||
{
|
||||
@@ -1,10 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Tests;
|
||||
|
||||
use Exception;
|
||||
use App\Exceptions\Handler;
|
||||
use Illuminate\Contracts\Debug\ExceptionHandler;
|
||||
|
||||
abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
abstract class TestCase extends \Illuminate\Foundation\Testing\TestCase
|
||||
{
|
||||
use CreatesApplication;
|
||||
|
||||
/**
|
||||
* The base URL to use while testing the application.
|
||||
*
|
||||
@@ -17,20 +22,6 @@ abstract class TestCase extends Illuminate\Foundation\Testing\TestCase
|
||||
parent::setUp();
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the application.
|
||||
*
|
||||
* @return \Illuminate\Foundation\Application
|
||||
*/
|
||||
public function createApplication()
|
||||
{
|
||||
$app = require __DIR__.'/../bootstrap/app.php';
|
||||
|
||||
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
|
||||
|
||||
return $app;
|
||||
}
|
||||
|
||||
protected function disableExceptionHandling()
|
||||
{
|
||||
$this->app->instance(ExceptionHandler::class, new class extends Handler {
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Billing;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Billing\FakePaymentGateway;
|
||||
use App\Billing\PaymentFailedException;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class FakePaymentGatewayTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Billing;
|
||||
|
||||
use App\Billing\PaymentFailedException;
|
||||
|
||||
trait PaymentGatewayContractTests
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Billing;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\Billing\StripePaymentGateway;
|
||||
use App\Billing\PaymentFailedException;
|
||||
|
||||
/**
|
||||
* @group integration
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Order;
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Tests\TestCase;
|
||||
use App\Exceptions\NotEnoughTicketsException;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ConcertTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Ticket;
|
||||
use Tests\TestCase;
|
||||
use App\HashidsTicketCodeGenerator;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class HashidsTicketCodeGeneratorTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit\Mail;
|
||||
|
||||
use App\Order;
|
||||
use Tests\TestCase;
|
||||
use App\Mail\OrderConfirmationEmail;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class OrderConfirmationEmailTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Mockery;
|
||||
use App\Order;
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use App\Reservation;
|
||||
use Tests\TestCase;
|
||||
use App\Billing\Charge;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
|
||||
class OrderTest extends TestCase
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Tests\TestCase;
|
||||
use App\RandomOrderConfirmationNumberGenerator;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class RandomOrderConfirmationNumberGeneratorTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use Mockery;
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use Tests\TestCase;
|
||||
use App\Reservation;
|
||||
use App\Billing\FakePaymentGateway;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class ReservationTest extends TestCase
|
||||
{
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Tests\Unit;
|
||||
|
||||
use App\Order;
|
||||
use App\Ticket;
|
||||
use App\Concert;
|
||||
use Carbon\Carbon;
|
||||
use Tests\TestCase;
|
||||
use App\Facades\TicketCode;
|
||||
use Illuminate\Foundation\Testing\WithoutMiddleware;
|
||||
use Illuminate\Foundation\Testing\DatabaseMigrations;
|
||||
use Illuminate\Foundation\Testing\DatabaseTransactions;
|
||||
|
||||
class TicketTest extends TestCase
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user