html2pdf mit composer hinzugefügt

This commit is contained in:
aschwarz
2023-02-16 09:19:46 +01:00
parent 3dcc93a65d
commit d1ab7f3763
613 changed files with 134681 additions and 0 deletions

View File

@ -0,0 +1,42 @@
<?php
/**
* Html2Pdf Library - Tests
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Tests\Image;
use Spipu\Html2Pdf\Exception\ImageException;
use Spipu\Html2Pdf\Tests\AbstractTest;
/**
* Class BackgroundErrorTest
*/
class BackgroundErrorTest extends AbstractTest
{
/**
* test: The image src is unknown
*
* @return void
*/
public function testCase()
{
$this->expectException(ImageException::class);
$image = '/res/wrong.png';
try {
$object = $this->getObject();
$object->writeHTML('<div style="background-image: url('.$image.')">Hello World</div>');
$object->output('test.pdf', 'S');
} catch (ImageException $e) {
$this->assertSame($image, $e->getImage());
throw $e;
}
}
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Html2Pdf Library - Tests
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Tests\Image;
use Spipu\Html2Pdf\Tests\AbstractTest;
/**
* Class BackgroundOkTest
*/
class BackgroundOkTest extends AbstractTest
{
/**
* test: The image src is unknown
*
* @return void
*/
public function testCase()
{
$object = $this->getObject();
$object->writeHTML('<div style="background-image: url('.dirname(__FILE__).'/res/logo.png)">Hello World</div>');
$result = $object->output('test.pdf', 'S');
$this->assertContains('PhpUnit Test', $result);
}
}

View File

@ -0,0 +1,42 @@
<?php
/**
* Html2Pdf Library - Tests
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Tests\Image;
use Spipu\Html2Pdf\Exception\ImageException;
use Spipu\Html2Pdf\Tests\AbstractTest;
/**
* Class SrcErrorTest
*/
class SrcErrorTest extends AbstractTest
{
/**
* test: The image src is unknown
*
* @return void
*/
public function testCase()
{
$this->expectException(ImageException::class);
$image = '/res/wrong.png';
try {
$object = $this->getObject();
$object->writeHTML('Hello World <img src="'.$image.'" />');
$object->output('test.pdf', 'S');
} catch (ImageException $e) {
$this->assertSame($image, $e->getImage());
throw $e;
}
}
}

View File

@ -0,0 +1,35 @@
<?php
/**
* Html2Pdf Library - Tests
*
* HTML => PDF converter
* distributed under the OSL-3.0 License
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2017 Laurent MINGUET
*/
namespace Spipu\Html2Pdf\Tests\Image;
use Spipu\Html2Pdf\Tests\AbstractTest;
/**
* Class SrcOkTest
*/
class SrcOkTest extends AbstractTest
{
/**
* test: The image src is unknown
*
* @return void
*/
public function testCase()
{
$object = $this->getObject();
$object->writeHTML('Hello World <img src="'.dirname(__FILE__).'/res/logo.png" />');
$result = $object->output('test.pdf', 'S');
$this->assertContains('PhpUnit Test', $result);
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB