source: trunk/client/inc/hpdf5/spipu/html2pdf/src/Tests/Html2PdfTest.php@ 404

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

Aggiornamento per compatibilità con php7.4

File size: 804 bytes
Line 
1<?php
2
3namespace Spipu\Html2Pdf\Tests;
4
5use Phake;
6use Spipu\Html2Pdf\Html2Pdf;
7
8/**
9 * Class Html2PdfTest
10 */
11class 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.