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 declare(strict_types=1); namespace Intervention\Image\Tests\Unit\Geometry\Factorie..

Decoded Output download

<?php

declare(strict_types=1);

namespace Intervention\Image\Tests\Unit\Geometry\Factories;

use Intervention\Image\Geometry\Factories\LineFactory;
use Intervention\Image\Geometry\Line;
use Intervention\Image\Tests\BaseTestCase;

final class LineFactoryTest extends BaseTestCase
{
    public function testFactoryCallback(): void
    {
        $factory = new LineFactory(function ($line) {
            $line->color('fff');
            $line->background('fff');
            $line->border('fff', 10);
            $line->width(10);
            $line->from(100, 200);
            $line->to(300, 400);
        });

        $line = $factory();
        $this->assertInstanceOf(Line::class, $line);
        $this->assertTrue($line->hasBackgroundColor());
        $this->assertEquals('fff', $line->backgroundColor());
        $this->assertEquals(100, $line->start()->x());
        $this->assertEquals(200, $line->start()->y());
        $this->assertEquals(300, $line->end()->x());
        $this->assertEquals(400, $line->end()->y());
        $this->assertEquals(10, $line->width());
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

declare(strict_types=1);

namespace Intervention\Image\Tests\Unit\Geometry\Factories;

use Intervention\Image\Geometry\Factories\LineFactory;
use Intervention\Image\Geometry\Line;
use Intervention\Image\Tests\BaseTestCase;

final class LineFactoryTest extends BaseTestCase
{
    public function testFactoryCallback(): void
    {
        $factory = new LineFactory(function ($line) {
            $line->color('fff');
            $line->background('fff');
            $line->border('fff', 10);
            $line->width(10);
            $line->from(100, 200);
            $line->to(300, 400);
        });

        $line = $factory();
        $this->assertInstanceOf(Line::class, $line);
        $this->assertTrue($line->hasBackgroundColor());
        $this->assertEquals('fff', $line->backgroundColor());
        $this->assertEquals(100, $line->start()->x());
        $this->assertEquals(200, $line->start()->y());
        $this->assertEquals(300, $line->end()->x());
        $this->assertEquals(400, $line->end()->y());
        $this->assertEquals(10, $line->width());
    }
}

Function Calls

None

Variables

None

Stats

MD5 acd317f6f2295137fc1b27fec4eb20b9
Eval Count 0
Decode Time 119 ms