Skip to content

Commit

Permalink
Merge branch '3.2'
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json

Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Jan 21, 2016
2 parents 9b2d161 + 872ea88 commit d47f2ad
Show file tree
Hide file tree
Showing 6 changed files with 78 additions and 5 deletions.
7 changes: 6 additions & 1 deletion docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ title: Testbench Change Log

## Version 3.2 {#v3-2}

### v3.2.1 {#v3-2-1}

* Bump to Laravel Framework v5.2.7+.
* Add `Orchestra\Testbench\ApplicationTestCase` and `Orchestra\Testbench\Exceptions\ApplicationHandler` for full Laravel integration testing support. ([@rydurham](https://github.com/rydurham))

### v3.2.0 {#v3-2-0}

* Update support for Laravel Framework v5.2.
Expand All @@ -17,7 +22,7 @@ title: Testbench Change Log

### v3.1.7 {#v3-1-7}

* Bump to Laravel Framework v5.1.27.
* Bump to Laravel Framework v5.1.27+.
* Add `Orchestra\Testbench\Traits\WithFactories` trait to allow packages to load model factories when running packages test suite.

### v3.1.6 {#v3-1-6}
Expand Down
16 changes: 16 additions & 0 deletions src/ApplictionTestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php namespace Orchestra\Testbench;

class ApplicationTestCase extends TestCase
{
/**
* Resolve application HTTP exception handler.
*
* @param \Illuminate\Foundation\Application $app
*
* @return void
*/
protected function resolveApplicationExceptionHandler($app)
{
$app->singleton('Illuminate\Contracts\Debug\ExceptionHandler', 'Orchestra\Testbench\Exceptions\ApplicationHandler');
}
}
50 changes: 50 additions & 0 deletions src/Exceptions/ApplicationHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<?php namespace Orchestra\Testbench\Exceptions;

use Exception;
use Illuminate\Validation\ValidationException;
use Illuminate\Foundation\Testing\HttpException;
use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;

class ApplicationHandler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
*
* @var array
*/
protected $dontReport = [
AuthorizationException::class,
HttpException::class,
ModelNotFoundException::class,
ValidationException::class,
];

/**
* Report or log an exception.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
*
* @param \Exception $e
*
* @return void
*/
public function report(Exception $e)
{
parent::report($e);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
*
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
{
return parent::render($request, $e);
}
}
8 changes: 4 additions & 4 deletions src/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ class Kernel extends \Illuminate\Foundation\Http\Kernel
],
];

/**
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => Middleware\Authenticate::class,
'auth' => Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'guest' => Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'guest' => Middleware\RedirectIfAuthenticated::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
];

/**
Expand Down
1 change: 1 addition & 0 deletions src/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class Authenticate
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
Expand Down
1 change: 1 addition & 0 deletions src/Http/Middleware/RedirectIfAuthenticated.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class RedirectIfAuthenticated
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
*
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
Expand Down

0 comments on commit d47f2ad

Please sign in to comment.