Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.148.167.99
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
3 /
league /
glide /
tests /
Manipulators /
Delete
Unzip
Name
Size
Permission
Date
Action
Helpers
[ DIR ]
drwxr-xr-x
2020-11-05 09:00
BackgroundTest.php
1.27
KB
-rw-r--r--
2020-11-05 09:00
BlurTest.php
1.38
KB
-rw-r--r--
2020-11-05 09:00
BorderTest.php
3.98
KB
-rw-r--r--
2020-11-05 09:00
BrightnessTest.php
1.43
KB
-rw-r--r--
2020-11-05 09:00
ContrastTest.php
1.41
KB
-rw-r--r--
2020-11-05 09:00
CropTest.php
2.8
KB
-rw-r--r--
2020-11-05 09:00
EncodeTest.php
5.64
KB
-rw-r--r--
2020-11-05 09:00
FilterTest.php
2.32
KB
-rw-r--r--
2020-11-05 09:00
FlipTest.php
1.26
KB
-rw-r--r--
2020-11-05 09:00
GammaTest.php
1.57
KB
-rw-r--r--
2020-11-05 09:00
OrientationTest.php
1.88
KB
-rw-r--r--
2020-11-05 09:00
PixelateTest.php
1.43
KB
-rw-r--r--
2020-11-05 09:00
SharpenTest.php
1.42
KB
-rw-r--r--
2020-11-05 09:00
SizeTest.php
10.42
KB
-rw-r--r--
2020-11-05 09:00
WatermarkTest.php
9.61
KB
-rw-r--r--
2020-11-05 09:00
Save
Rename
<?php namespace League\Glide\Manipulators; use Intervention\Image\ImageManager; use Mockery; use PHPUnit\Framework\TestCase; class EncodeTest extends TestCase { private $manipulator; private $jpg; private $png; private $gif; private $tif; private $webp; public function setUp(): void { $manager = new ImageManager(); $this->jpg = $manager->canvas(100, 100)->encode('jpg'); $this->png = $manager->canvas(100, 100)->encode('png'); $this->gif = $manager->canvas(100, 100)->encode('gif'); if (function_exists('imagecreatefromwebp')) { $this->webp = $manager->canvas(100, 100)->encode('webp'); } $this->manipulator = new Encode(); } public function tearDown(): void { Mockery::close(); } public function testCreateInstance() { $this->assertInstanceOf('League\Glide\Manipulators\Encode', $this->manipulator); } public function testRun() { $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'jpg'])->run($this->jpg)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'jpg'])->run($this->png)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'jpg'])->run($this->gif)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'pjpg'])->run($this->jpg)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'pjpg'])->run($this->png)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'pjpg'])->run($this->gif)->mime); $this->assertSame('image/png', $this->manipulator->setParams(['fm' => 'png'])->run($this->jpg)->mime); $this->assertSame('image/png', $this->manipulator->setParams(['fm' => 'png'])->run($this->png)->mime); $this->assertSame('image/png', $this->manipulator->setParams(['fm' => 'png'])->run($this->gif)->mime); $this->assertSame('image/gif', $this->manipulator->setParams(['fm' => 'gif'])->run($this->jpg)->mime); $this->assertSame('image/gif', $this->manipulator->setParams(['fm' => 'gif'])->run($this->png)->mime); $this->assertSame('image/gif', $this->manipulator->setParams(['fm' => 'gif'])->run($this->gif)->mime); if (function_exists('imagecreatefromwebp')) { $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'jpg'])->run($this->webp)->mime); $this->assertSame('image/jpeg', $this->manipulator->setParams(['fm' => 'pjpg'])->run($this->webp)->mime); $this->assertSame('image/png', $this->manipulator->setParams(['fm' => 'png'])->run($this->webp)->mime); $this->assertSame('image/gif', $this->manipulator->setParams(['fm' => 'gif'])->run($this->webp)->mime); $this->assertSame('image/webp', $this->manipulator->setParams(['fm' => 'webp'])->run($this->jpg)->mime); $this->assertSame('image/webp', $this->manipulator->setParams(['fm' => 'webp'])->run($this->png)->mime); $this->assertSame('image/webp', $this->manipulator->setParams(['fm' => 'webp'])->run($this->gif)->mime); $this->assertSame('image/webp', $this->manipulator->setParams(['fm' => 'webp'])->run($this->webp)->mime); } } public function testGetFormat() { $image = Mockery::mock('Intervention\Image\Image', function ($mock) { $mock->shouldReceive('mime')->andReturn('image/jpeg')->once(); $mock->shouldReceive('mime')->andReturn('image/png')->once(); $mock->shouldReceive('mime')->andReturn('image/gif')->once(); $mock->shouldReceive('mime')->andReturn('image/bmp')->once(); $mock->shouldReceive('mime')->andReturn('image/jpeg')->twice(); if (function_exists('imagecreatefromwebp')) { $mock->shouldReceive('mime')->andReturn('image/webp')->once(); } }); $this->assertSame('jpg', $this->manipulator->setParams(['fm' => 'jpg'])->getFormat($image)); $this->assertSame('png', $this->manipulator->setParams(['fm' => 'png'])->getFormat($image)); $this->assertSame('gif', $this->manipulator->setParams(['fm' => 'gif'])->getFormat($image)); $this->assertSame('jpg', $this->manipulator->setParams(['fm' => null])->getFormat($image)); $this->assertSame('png', $this->manipulator->setParams(['fm' => null])->getFormat($image)); $this->assertSame('gif', $this->manipulator->setParams(['fm' => null])->getFormat($image)); $this->assertSame('jpg', $this->manipulator->setParams(['fm' => null])->getFormat($image)); $this->assertSame('jpg', $this->manipulator->setParams(['fm' => ''])->getFormat($image)); $this->assertSame('jpg', $this->manipulator->setParams(['fm' => 'invalid'])->getFormat($image)); if (function_exists('imagecreatefromwebp')) { $this->assertSame('webp', $this->manipulator->setParams(['fm' => null])->getFormat($image)); } } public function testGetQuality() { $this->assertSame(100, $this->manipulator->setParams(['q' => '100'])->getQuality()); $this->assertSame(100, $this->manipulator->setParams(['q' => 100])->getQuality()); $this->assertSame(90, $this->manipulator->setParams(['q' => null])->getQuality()); $this->assertSame(90, $this->manipulator->setParams(['q' => 'a'])->getQuality()); $this->assertSame(50, $this->manipulator->setParams(['q' => '50.50'])->getQuality()); $this->assertSame(90, $this->manipulator->setParams(['q' => '-1'])->getQuality()); $this->assertSame(90, $this->manipulator->setParams(['q' => '101'])->getQuality()); } }