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 Symfony\Bridge\PhpUnit\Tests\DeprecationErrorHandler; use PHPUnit\Framew..

Decoded Output download

<?php

namespace Symfony\Bridge\PhpUnit\Tests\DeprecationErrorHandler;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\DeprecationNotice;

final class DeprecationNoticeTest extends TestCase
{
    public function testItGroupsByCaller()
    {
        $notice = new DeprecationNotice();
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $notice->addObjectOccurrence('MyOtherAction', '__invoke');

        $countsByCaller = $notice->getCountsByCaller();

        $this->assertCount(2, $countsByCaller);
        $this->assertArrayHasKey('MyAction::__invoke', $countsByCaller);
        $this->assertArrayHasKey('MyOtherAction::__invoke', $countsByCaller);
        $this->assertSame(2, $countsByCaller['MyAction::__invoke']);
        $this->assertSame(1, $countsByCaller['MyOtherAction::__invoke']);
    }

    public function testItCountsBothTypesOfOccurrences()
    {
        $notice = new DeprecationNotice();
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $this->assertSame(1, $notice->count());

        $notice->addProceduralOccurrence();
        $this->assertSame(2, $notice->count());
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Symfony\Bridge\PhpUnit\Tests\DeprecationErrorHandler;

use PHPUnit\Framework\TestCase;
use Symfony\Bridge\PhpUnit\DeprecationErrorHandler\DeprecationNotice;

final class DeprecationNoticeTest extends TestCase
{
    public function testItGroupsByCaller()
    {
        $notice = new DeprecationNotice();
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $notice->addObjectOccurrence('MyOtherAction', '__invoke');

        $countsByCaller = $notice->getCountsByCaller();

        $this->assertCount(2, $countsByCaller);
        $this->assertArrayHasKey('MyAction::__invoke', $countsByCaller);
        $this->assertArrayHasKey('MyOtherAction::__invoke', $countsByCaller);
        $this->assertSame(2, $countsByCaller['MyAction::__invoke']);
        $this->assertSame(1, $countsByCaller['MyOtherAction::__invoke']);
    }

    public function testItCountsBothTypesOfOccurrences()
    {
        $notice = new DeprecationNotice();
        $notice->addObjectOccurrence('MyAction', '__invoke');
        $this->assertSame(1, $notice->count());

        $notice->addProceduralOccurrence();
        $this->assertSame(2, $notice->count());
    }
}

Function Calls

None

Variables

None

Stats

MD5 60edff0e5d44d1c891ec456c4208f714
Eval Count 0
Decode Time 87 ms