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\Drivers\Imagick\M..
Decoded Output download
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Modifiers;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Intervention\Image\Modifiers\CoverDownModifier;
use Intervention\Image\Tests\ImagickTestCase;
#[RequiresPhpExtension('imagick')]
#[CoversClass(\Intervention\Image\Modifiers\CoverModifier::class)]
#[CoversClass(\Intervention\Image\Drivers\Imagick\Modifiers\CoverModifier::class)]
final class CoverDownModifierTest extends ImagickTestCase
{
public function testModify(): void
{
$image = $this->readTestImage('blocks.png');
$this->assertEquals(640, $image->width());
$this->assertEquals(480, $image->height());
$image->modify(new CoverDownModifier(100, 100, 'center'));
$this->assertEquals(100, $image->width());
$this->assertEquals(100, $image->height());
$this->assertColor(255, 0, 0, 255, $image->pickColor(90, 90));
$this->assertColor(0, 255, 0, 255, $image->pickColor(65, 70));
$this->assertColor(0, 0, 255, 255, $image->pickColor(70, 52));
$this->assertTransparency($image->pickColor(90, 30));
}
public function testModifyOddSize(): void
{
$image = $this->createTestImage(375, 250);
$image->modify(new CoverDownModifier(240, 90, 'center'));
$this->assertEquals(240, $image->width());
$this->assertEquals(90, $image->height());
}
}
?>
Did this file decode correctly?
Original Code
<?php
declare(strict_types=1);
namespace Intervention\Image\Tests\Unit\Drivers\Imagick\Modifiers;
use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use Intervention\Image\Modifiers\CoverDownModifier;
use Intervention\Image\Tests\ImagickTestCase;
#[RequiresPhpExtension('imagick')]
#[CoversClass(\Intervention\Image\Modifiers\CoverModifier::class)]
#[CoversClass(\Intervention\Image\Drivers\Imagick\Modifiers\CoverModifier::class)]
final class CoverDownModifierTest extends ImagickTestCase
{
public function testModify(): void
{
$image = $this->readTestImage('blocks.png');
$this->assertEquals(640, $image->width());
$this->assertEquals(480, $image->height());
$image->modify(new CoverDownModifier(100, 100, 'center'));
$this->assertEquals(100, $image->width());
$this->assertEquals(100, $image->height());
$this->assertColor(255, 0, 0, 255, $image->pickColor(90, 90));
$this->assertColor(0, 255, 0, 255, $image->pickColor(65, 70));
$this->assertColor(0, 0, 255, 255, $image->pickColor(70, 52));
$this->assertTransparency($image->pickColor(90, 30));
}
public function testModifyOddSize(): void
{
$image = $this->createTestImage(375, 250);
$image->modify(new CoverDownModifier(240, 90, 'center'));
$this->assertEquals(240, $image->width());
$this->assertEquals(90, $image->height());
}
}
Function Calls
None |
Stats
MD5 | 059b64c2317e929bb8e87399c19a6275 |
Eval Count | 0 |
Decode Time | 98 ms |