Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace Illuminate\Tests\Console; use Illuminate\Console\Signals; use Illuminate..

Decoded Output download

<?php

namespace Illuminate\Tests\Console;

use Illuminate\Console\Signals;
use Illuminate\Tests\Console\Fixtures\FakeSignalsRegistry;
use PHPUnit\Framework\TestCase;

class SignalsTest extends TestCase
{
    protected $registry;

    protected $signals;

    protected $state;

    protected function setUp(): void
    {
        $this->registry = new FakeSignalsRegistry();
        $this->signals = new Signals($this->registry);
    }

    protected function tearDown(): void
    {
        $this->state = null;

        parent::tearDown();
    }

    public function testRegister()
    {
        $this->signals->register('my-signal', function () {
            $this->state .= 'otwell';
        });

        $this->signals->register('my-signal', function () {
            $this->state = 'taylor';
        });

        $this->registry->handle('my-signal');

        $this->assertSame('taylorotwell', $this->state);
    }

    public function testUnregister()
    {
        $this->signals->register('my-signal', function () {
            $this->state .= 'otwell';
        });

        $this->signals->register('my-signal', function () {
            $this->state = 'taylor';
        });

        $this->signals->unregister();

        $this->registry->handle('my-signal');

        $this->assertNull($this->state);
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Illuminate\Tests\Console;

use Illuminate\Console\Signals;
use Illuminate\Tests\Console\Fixtures\FakeSignalsRegistry;
use PHPUnit\Framework\TestCase;

class SignalsTest extends TestCase
{
    protected $registry;

    protected $signals;

    protected $state;

    protected function setUp(): void
    {
        $this->registry = new FakeSignalsRegistry();
        $this->signals = new Signals($this->registry);
    }

    protected function tearDown(): void
    {
        $this->state = null;

        parent::tearDown();
    }

    public function testRegister()
    {
        $this->signals->register('my-signal', function () {
            $this->state .= 'otwell';
        });

        $this->signals->register('my-signal', function () {
            $this->state = 'taylor';
        });

        $this->registry->handle('my-signal');

        $this->assertSame('taylorotwell', $this->state);
    }

    public function testUnregister()
    {
        $this->signals->register('my-signal', function () {
            $this->state .= 'otwell';
        });

        $this->signals->register('my-signal', function () {
            $this->state = 'taylor';
        });

        $this->signals->unregister();

        $this->registry->handle('my-signal');

        $this->assertNull($this->state);
    }
}

Function Calls

None

Variables

None

Stats

MD5 2bbb965c8d24d9d6b4e83100dcf4aa5e
Eval Count 0
Decode Time 101 ms