2017 © Pedro Peláez
 

library pdfunit

Unittests for comparing PDF-files

image

org_heigl/pdfunit

Unittests for comparing PDF-files

  • Monday, June 22, 2015
  • by heiglandreas
  • Repository
  • 1 Watchers
  • 0 Stars
  • 15 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

PDFUnit

An extension to PHPUnit to test creation of PDF-Files., (*1)

About

Creating PDF-Files is always a bit difficult as the best comparison is a visual one., (*2)

As 2 PDF-Files can be internally completely different there is no way of comparing them on a source-code-level. Therefore comparing them by creating an image and comparing that to a known-good file. The differences between the two files are calculated and measured against a threshold., (*3)

Requirements

This package requires imagemagicks compare-binary to be installed and available in the path., (*4)

Installation

$ composer require org_heigl/pdfunit

Usage

namespace Acme;

use Org_Heigl\PDFUnit\TestCase;

class PDFTest extends TestCase
{
    public function testPdf()
    {
        $this->assertPdfDiffBelowThreshold(
            'known-good.pdf',
            0.4,
            'generated.pdf'
        );
    }
}

This will compare generated.pdf agains known-good.pdf and checks whether the difference is less or equals to 0.4., (*5)

The Versions

22/06 2015

dev-master

9999999-dev https://github.com/heiglandreas/PDFUnit

Unittests for comparing PDF-files

  Sources   Download

MIT

The Requires

 

unittest pdf unittests

17/06 2015

1.0.0

1.0.0.0 https://github.com/heiglandreas/PDFUnit

Unittests for comparing PDF-files

  Sources   Download

MIT

The Requires

 

unittest pdf unittests