PHPackages                             meyfa/phpunit-assert-gd - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Testing &amp; Quality](/categories/testing)
4. /
5. meyfa/phpunit-assert-gd

ActiveLibrary[Testing &amp; Quality](/categories/testing)

meyfa/phpunit-assert-gd
=======================

PHPUnit matcher/assertions for GD image resources

v4.2.0(10mo ago)12560.2k—1.3%5[1 PRs](https://github.com/meyfa/phpunit-assert-gd/pulls)12MITPHPPHP &gt;=8.1CI passing

Since Feb 1Pushed 10mo ago3 watchersCompare

[ Source](https://github.com/meyfa/phpunit-assert-gd)[ Packagist](https://packagist.org/packages/meyfa/phpunit-assert-gd)[ Docs](https://github.com/meyfa/phpunit-assert-gd)[ RSS](/packages/meyfa-phpunit-assert-gd/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (10)Dependencies (2)Versions (19)Used By (12)

AssertGD for PHPUnit
====================

[](#assertgd-for-phpunit)

[![CI](https://github.com/meyfa/phpunit-assert-gd/actions/workflows/main.yml/badge.svg)](https://github.com/meyfa/phpunit-assert-gd/actions/workflows/main.yml)

Trying to assert images with PHPUnit? This project provides a constraint and the required assertions that allow you do to so.

It supports comparing **files on disk** as well as **image resources** in memory.

Installation
------------

[](#installation)

Add this package to your Composer dev-dependencies:

```
composer require --dev meyfa/phpunit-assert-gd

```

**Compatibility table**

AssertGD versionSupported PHP versionSupported PHPUnit version4.\*&gt;= 8.1^10.1 and ^11.03.\*&gt;= 7.392.\*&gt;= 7.281.\*5.3.3 - 8.04.8.36 - 6.5.0Examples
--------

[](#examples)

The assertions are available as a [trait](http://php.net/manual/en/language.oop5.traits.php), so you can easily `use` them in your test case class:

```
