Skip to content

Commit

Permalink
laravel 5.8
Browse files Browse the repository at this point in the history
  • Loading branch information
recca0120 committed Feb 28, 2019
1 parent dc181c2 commit 1f4a734
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -7,6 +7,7 @@ php:
- 7.0
- 7.1
- 7.2
- 7.3
- hhvm

env:
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -103,6 +103,7 @@ copy <vendor path>/recca0120/laravel-tracy/tools/subl-handler/subl-handler.vbs t
double click subl-handler.vbs and select editor (support eclipse, sublime, notepad++, else...)
```
If you use Vagrant and have issues with the incorrect path being called, you can create a symlink as illustrated at: https://prnt.sc/lpswki

OSX
```
Expand Down
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -22,8 +22,9 @@
},
"require-dev": {
"mockery/mockery": "~0.9.4|~1.0",
"nesbot/carbon": "~1.20",
"phpunit/phpunit": "~4.8|~5.4|~6.1|~7.0",
"nesbot/carbon": "~1.20"
"vlucas/phpdotenv": "^3.3"
},
"autoload": {
"files": [
Expand Down
6 changes: 3 additions & 3 deletions src/DebuggerManager.php
Expand Up @@ -274,10 +274,10 @@ protected function renderBar($content)
protected function render($content, $method, $appendTags = ['body'])
{
$appendHtml = $this->renderBuffer(function () use ($method) {
$requestUri = $_SERVER['REQUEST_URI'];
$_SERVER['REQUEST_URI'] = '';
$requestUri = Arr::get($_SERVER, 'REQUEST_URI');
Arr::set($_SERVER, 'REQUEST_URI', '');
call_user_func([$this->bar, $method]);
$_SERVER['REQUEST_URI'] = $requestUri;
Arr::set($_SERVER, 'REQUEST_URI', $requestUri);
});

$appendTags = array_unique($appendTags);
Expand Down
11 changes: 11 additions & 0 deletions src/Exceptions/Handler.php
Expand Up @@ -48,6 +48,17 @@ public function report(Exception $e)
$this->exceptionHandler->report($e);
}

/**
* Determine if the exception should be reported.
*
* @param \Exception $e
* @return bool
*/
public function shouldReport(Exception $e)
{
return $this->exceptionHandler->shouldReport($e);
}

/**
* Render an exception into an HTTP response.
*
Expand Down
6 changes: 6 additions & 0 deletions tests/DebuggerManagerTest.php
Expand Up @@ -88,6 +88,8 @@ public function testDispatchAssetsCss()
$content = 'foo';
$bar->shouldReceive('dispatchAssets')->once()->andReturnUsing(function () use ($content) {
echo $content;

return true;
});

$this->assertSame([
Expand All @@ -112,6 +114,8 @@ public function testDispatchAssetsJs()
$content = 'foo';
$bar->shouldReceive('dispatchAssets')->once()->andReturnUsing(function () use ($content) {
echo $content;

return true;
});

$this->assertSame([
Expand Down Expand Up @@ -139,6 +143,8 @@ public function testDispatchAssetsContentId()
$content = 'foo';
$bar->shouldReceive('dispatchAssets')->once()->andReturnUsing(function () use ($content) {
echo $content;

return true;
});

$this->assertSame([
Expand Down
12 changes: 12 additions & 0 deletions tests/Exceptions/HandlerTest.php
Expand Up @@ -48,6 +48,18 @@ public function testReport()
$this->assertNull($handler->report($exception));
}

public function testShouldReport()
{
$handler = new Handler(
$exceptionHandler = m::mock('Illuminate\Contracts\Debug\ExceptionHandler'),
$debuggerManager = m::mock('Recca0120\LaravelTracy\DebuggerManager')
);
$exception = new Exception();
$exceptionHandler->shouldReceive('shouldReport')->once()->with($exception)->andReturn(true);

$this->assertTrue($handler->shouldReport($exception));
}

public function testRednerWithResponseIsRedirectResponse()
{
$handler = new Handler(
Expand Down

0 comments on commit 1f4a734

Please sign in to comment.