Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid making call to flare #381

Merged
merged 5 commits into from
Apr 29, 2021
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
4 changes: 4 additions & 0 deletions src/Logger/FlareHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ function (Report $flareReport) use ($report) {

protected function shouldReport(array $report): bool
{
if (! config('flare.key')) {
return false;
}

return $this->hasException($report) || $this->hasValidLogLevel($report);
}

Expand Down
8 changes: 0 additions & 8 deletions tests/Commands/TestCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Facade\Ignition\Tests\Commands;

use Facade\Ignition\Tests\TestCase;
use Symfony\Component\Console\Exception\CommandNotFoundException;

class TestCommandTest extends TestCase
{
Expand All @@ -23,13 +22,6 @@ public function withFlareKey()
$this->refreshApplication();
}

/** @test */
public function it_can_not_find_the_test_command_without_a_flare_key()
{
$this->expectException(CommandNotFoundException::class);
$testResult = $this->artisan('flare:test');
}

/** @test */
public function it_can_execute_the_test_command_when_a_flare_key_is_present()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ public function setUp(): void

protected function getPackageProviders($app)
{
config()->set('flare.key', 'dummy-key');

return [IgnitionServiceProvider::class];
}

Expand Down