Last change
on this file since 398 was 347, checked in by roby, 3 years ago |
Aggiornamento per compatibilità con php7.4
|
File size:
804 bytes
|
Line | |
---|
1 | <?php
|
---|
2 |
|
---|
3 | namespace Spipu\Html2Pdf\Tests;
|
---|
4 |
|
---|
5 | use Phake;
|
---|
6 | use Spipu\Html2Pdf\Html2Pdf;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Class Html2PdfTest
|
---|
10 | */
|
---|
11 | class Html2PdfTest extends AbstractTest
|
---|
12 | {
|
---|
13 | public function testExtensionTag()
|
---|
14 | {
|
---|
15 | $tag = Phake::mock('Spipu\Html2Pdf\Tag\TagInterface');
|
---|
16 | Phake::when($tag)->getName()->thenReturn('test_tag');
|
---|
17 |
|
---|
18 | $extension = Phake::mock('Spipu\Html2Pdf\Extension\ExtensionInterface');
|
---|
19 | Phake::when($extension)->getName()->thenReturn('test');
|
---|
20 | Phake::when($extension)->getTags()->thenReturn(array($tag));
|
---|
21 |
|
---|
22 | $object = $this->getObject();
|
---|
23 |
|
---|
24 | $object->addExtension($extension);
|
---|
25 | $object->writeHTML('<div><test_tag>Hello</test_tag></div>');
|
---|
26 |
|
---|
27 | Phake::verify($tag, Phake::times(4))->open;
|
---|
28 | Phake::verify($tag, Phake::times(2))->close;
|
---|
29 | }
|
---|
30 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.