-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b86e08a
commit f071b59
Showing
20 changed files
with
387 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
ARG PHP_VERSION | ||
FROM php:$PHP_VERSION | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
git \ | ||
unzip \ | ||
wget \ | ||
zip | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
COPY --from=composer /usr/bin/composer /usr/local/bin/composer | ||
|
||
RUN cp .env.example .env | ||
RUN composer install --no-dev | ||
RUN php artisan key:generate | ||
|
||
# create database & apply migrations | ||
RUN touch database/database.sqlite && php artisan migrate --no-interaction | ||
|
||
CMD php -S 0.0.0.0:8000 -t public |
33 changes: 33 additions & 0 deletions
33
features/fixtures/laravel11/app/Http/Controllers/TestController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers; | ||
|
||
use Bugsnag\BugsnagLaravel\Facades\Bugsnag; | ||
use Exception; | ||
|
||
class TestController extends Controller | ||
{ | ||
public function unhandledException() | ||
{ | ||
throw new Exception('Crashing exception!'); | ||
} | ||
|
||
public function unhandledError() | ||
{ | ||
foo(); | ||
} | ||
|
||
public function handledException() | ||
{ | ||
Bugsnag::notifyException(new Exception('Handled exception')); | ||
|
||
return 'done'; | ||
} | ||
|
||
public function handledError() | ||
{ | ||
Bugsnag::notifyError('Handled error', 'This is a handled error'); | ||
|
||
return 'done'; | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
features/fixtures/laravel11/app/Http/Middleware/HandledMiddlewareErr.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Bugsnag\BugsnagLaravel\Facades\Bugsnag; | ||
use Closure; | ||
|
||
class HandledMiddlewareErr | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
Bugsnag::notifyError('Handled middleware error', 'This is a handled error'); | ||
return $next($request); | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
features/fixtures/laravel11/app/Http/Middleware/HandledMiddlewareEx.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Bugsnag\BugsnagLaravel\Facades\Bugsnag; | ||
use Closure; | ||
use Exception; | ||
|
||
class HandledMiddlewareEx | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
Bugsnag::notifyException(new Exception('Handled middleware exception')); | ||
return $next($request); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
features/fixtures/laravel11/app/Http/Middleware/UnhandledMiddlewareErr.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
|
||
class UnhandledMiddlewareErr | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
foo(); | ||
return $next($request); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
features/fixtures/laravel11/app/Http/Middleware/UnhandledMiddlewareEx.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
namespace App\Http\Middleware; | ||
|
||
use Closure; | ||
use Exception; | ||
|
||
class UnhandledMiddlewareEx | ||
{ | ||
public function handle($request, Closure $next) | ||
{ | ||
throw new Exception('Unhandled middleware exception'); | ||
return $next($request); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
use Bugsnag\BugsnagLaravel\Facades\Bugsnag; | ||
use Exception; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldBeUnique; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Queue\SerializesModels; | ||
|
||
class HandledJob implements ShouldQueue | ||
{ | ||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
Bugsnag::leaveBreadcrumb(__METHOD__); | ||
|
||
Bugsnag::notifyException(new Exception('Handled :)')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Jobs; | ||
|
||
use Bugsnag\BugsnagLaravel\Facades\Bugsnag; | ||
use Illuminate\Bus\Queueable; | ||
use Illuminate\Contracts\Queue\ShouldBeUnique; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
use Illuminate\Foundation\Bus\Dispatchable; | ||
use Illuminate\Queue\InteractsWithQueue; | ||
use Illuminate\Queue\SerializesModels; | ||
use RuntimeException; | ||
|
||
class UnhandledJob implements ShouldQueue | ||
{ | ||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels; | ||
|
||
/** | ||
* Execute the job. | ||
* | ||
* @return void | ||
*/ | ||
public function handle() | ||
{ | ||
Bugsnag::leaveBreadcrumb(__METHOD__); | ||
|
||
throw new RuntimeException('uh oh :o'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<?php | ||
|
||
return [ | ||
Bugsnag\BugsnagLaravel\BugsnagServiceProvider::class, | ||
App\Providers\AppServiceProvider::class, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
features/fixtures/laravel11/resources/views/handlederror.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="{{ app()->getLocale() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Laravel</title> | ||
</head> | ||
<body> | ||
<?php app('bugsnag')->notifyError("Handled error", "This is a handled error") ?> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
features/fixtures/laravel11/resources/views/handledexception.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="{{ app()->getLocale() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Laravel</title> | ||
</head> | ||
<body> | ||
<?php app('bugsnag')->notifyException(new Exception("Handled view exception")) ?> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
features/fixtures/laravel11/resources/views/unhandlederror.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="{{ app()->getLocale() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Laravel</title> | ||
</head> | ||
<body> | ||
<?php foo() ?> | ||
</body> | ||
</html> |
12 changes: 12 additions & 0 deletions
12
features/fixtures/laravel11/resources/views/unhandledexception.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!doctype html> | ||
<html lang="{{ app()->getLocale() }}"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>Laravel</title> | ||
</head> | ||
<body> | ||
<?php throw new Exception("Unhandled exception") ?> | ||
</body> | ||
</html> |
Oops, something went wrong.