Last change
on this file was 347, checked in by roby, 4 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
980 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 |
|
---|
13 | namespace Spipu\Html2Pdf\Tests\Image;
|
---|
14 |
|
---|
15 | use Spipu\Html2Pdf\Html2Pdf;
|
---|
16 | use Spipu\Html2Pdf\Exception\ImageException;
|
---|
17 | use Spipu\Html2Pdf\Tests\AbstractTest;
|
---|
18 |
|
---|
19 | /**
|
---|
20 | * Class SrcErrorTest
|
---|
21 | */
|
---|
22 | class SrcErrorTest extends AbstractTest
|
---|
23 | {
|
---|
24 | /**
|
---|
25 | * test: The image src is unknown
|
---|
26 | *
|
---|
27 | * @return void
|
---|
28 | * @expectedException \Spipu\Html2Pdf\Exception\ImageException
|
---|
29 | */
|
---|
30 | public function testCase()
|
---|
31 | {
|
---|
32 | $image = '/res/wrong.png';
|
---|
33 |
|
---|
34 | try {
|
---|
35 | $object = $this->getObject();
|
---|
36 | $object->writeHTML('Hello World <img src="'.$image.'" />');
|
---|
37 | $object->output('test.pdf', 'S');
|
---|
38 | } catch (ImageException $e) {
|
---|
39 | $this->assertSame($image, $e->getImage());
|
---|
40 | throw $e;
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.