1. Go to this page and download the library: Download meyfa/phpunit-assert-gd library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
meyfa / phpunit-assert-gd example snippets
use AssertGD\GDAssertTrait;
class ExampleTest extends PHPUnit\Framework\TestCase
{
// this trait adds the assert methods to your test case
use GDAssertTrait;
public function testSomething()
{
$this->assertSimilarGD('./tests/expected.png', './tests/actual.png');
}
}
use AssertGD\DiffCalculator\ScaledRgbChannels;
public function testImage()
{
$this->assertSimilarGD(
'expected.png',
'actual.png',
'',
0,
new ScaledRgbChannels()
);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.