Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/Illuminate/Foundation/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
use Illuminate\Contracts\Foundation\ExceptionRenderer;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Database\MultipleRecordsFoundException;
use Illuminate\Database\RecordNotFoundException;
use Illuminate\Database\RecordsNotFoundException;
use Illuminate\Foundation\Exceptions\Renderer\Renderer;
Expand Down Expand Up @@ -161,7 +160,6 @@ class Handler implements ExceptionHandlerContract
HttpException::class,
HttpResponseException::class,
ModelNotFoundException::class,
MultipleRecordsFoundException::class,
OriginMismatchException::class,
RecordNotFoundException::class,
RecordsNotFoundException::class,
Expand Down
10 changes: 10 additions & 0 deletions tests/Foundation/FoundationExceptionsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Illuminate\Contracts\Routing\ResponseFactory as ResponseFactoryContract;
use Illuminate\Contracts\Support\Responsable;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Database\MultipleRecordsFoundException;
use Illuminate\Database\RecordsNotFoundException;
use Illuminate\Foundation\Exceptions\Handler;
use Illuminate\Foundation\Testing\Concerns\InteractsWithExceptionHandling;
Expand Down Expand Up @@ -393,6 +394,15 @@ public function testRecordsNotFoundReturns404WithoutReporting()
$this->handler->report(new RecordsNotFoundException);
}

public function testMultipleRecordsFoundIsReported()
{
$logger = m::mock(LoggerInterface::class);
$this->container->instance(LoggerInterface::class, $logger);
$logger->shouldReceive('error')->withArgs(['2 records were found.', m::hasKey('exception')])->once();

$this->handler->report(new MultipleRecordsFoundException(2));
}

public function testItReturnsSpecificErrorViewIfExists()
{
$viewFactory = m::mock(ViewFactory::class);
Expand Down