source: trunk/client/inc/hpdf5/spipu/html2pdf/src/Tests/Image/BackgroundErrorTest.php@ 347

Last change on this file since 347 was 347, checked in by roby, 3 years ago

Aggiornamento per compatibilità con php7.4

File size: 993 bytes
Line 
1<?php
2/**
3 * Html2Pdf Library - Tests
4 *
5 * HTML => PDF converter
6 * distributed under the OSL-3.0 License
7 *
8 * @package Html2pdf
9 * @author Laurent MINGUET <webmaster@html2pdf.fr>
10 * @copyright 2017 Laurent MINGUET
11 */
12
13namespace Spipu\Html2Pdf\Tests\Image;
14
15use Spipu\Html2Pdf\Exception\ImageException;
16use Spipu\Html2Pdf\Tests\AbstractTest;
17
18/**
19 * Class BackgroundErrorTest
20 */
21class BackgroundErrorTest extends AbstractTest
22{
23 /**
24 * test: The image src is unknown
25 *
26 * @return void
27 * @expectedException \Spipu\Html2Pdf\Exception\ImageException
28 */
29 public function testCase()
30 {
31 $image = '/res/wrong.png';
32
33 try {
34 $object = $this->getObject();
35 $object->writeHTML('<div style="background-image: url('.$image.')">Hello World</div>');
36 $object->output('test.pdf', 'S');
37 } catch (ImageException $e) {
38 $this->assertSame($image, $e->getImage());
39 throw $e;
40 }
41 }
42}
Note: See TracBrowser for help on using the repository browser.