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 Barryvdh\Debugbar\Tests\DataCollector; use Barryvdh\Debugbar\Tests\TestC..

Decoded Output download

<?php

namespace Barryvdh\Debugbar\Tests\DataCollector;

use Barryvdh\Debugbar\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Arr;

class ViewCollectorTest extends TestCase
{
    use RefreshDatabase;

    protected function setUp(): void
    {
        parent::setUp();

        ini_set('xdebug.file_link_format', 'vscode://file/%f:%l');
    }

    public function testIdeLinksAreAbsolutePaths()
    {
        if (!ini_get('xdebug.file_link_format')) {
            $this->markTestSkipped(
                'The Xdebug extension is not available.'
            );
            return;
        }

        debugbar()->boot();

        /** @var \Barryvdh\Debugbar\DataCollector\ViewCollector $collector */
        $collector = debugbar()->getCollector('views');
        $collector->addView(
            view('dashboard')
        );

        tap(Arr::first($collector->collect()['templates']), function (array $template) {
            $this->assertEquals(
                'vscode://file/' . realpath(__DIR__ . '/../resources/views/dashboard.blade.php') . ':1',
                $template['xdebug_link']['url']
            );
        });
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

namespace Barryvdh\Debugbar\Tests\DataCollector;

use Barryvdh\Debugbar\Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Arr;

class ViewCollectorTest extends TestCase
{
    use RefreshDatabase;

    protected function setUp(): void
    {
        parent::setUp();

        ini_set('xdebug.file_link_format', 'vscode://file/%f:%l');
    }

    public function testIdeLinksAreAbsolutePaths()
    {
        if (!ini_get('xdebug.file_link_format')) {
            $this->markTestSkipped(
                'The Xdebug extension is not available.'
            );
            return;
        }

        debugbar()->boot();

        /** @var \Barryvdh\Debugbar\DataCollector\ViewCollector $collector */
        $collector = debugbar()->getCollector('views');
        $collector->addView(
            view('dashboard')
        );

        tap(Arr::first($collector->collect()['templates']), function (array $template) {
            $this->assertEquals(
                'vscode://file/' . realpath(__DIR__ . '/../resources/views/dashboard.blade.php') . ':1',
                $template['xdebug_link']['url']
            );
        });
    }
}

Function Calls

None

Variables

None

Stats

MD5 23fda965c2c7042a672730b9fc5dbfda
Eval Count 0
Decode Time 93 ms