承接 org_heigl/pdfunit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

org_heigl/pdfunit

最新稳定版本:1.0.0

Composer 安装命令:

composer require org_heigl/pdfunit

包简介

Unittests for comparing PDF-files

README 文档

README

An extension to PHPUnit to test creation of PDF-Files.

About

Creating PDF-Files is always a bit difficult as the best comparison is a visual one.

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.

Requirements

This package requires imagemagicks compare-binary to be installed and available in the path.

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.

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-17