diff --git a/CHANGELOG.md b/CHANGELOG.md index cb8072d1..868fbc7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to this project will be documented in this file. +## [5.2.7](https://github.com/spipu/html2pdf/compare/v5.2.6...v5.2.7) - 2023-02-02 + +* fix phunit compatibility + ## [5.2.6](https://github.com/spipu/html2pdf/compare/v5.2.5...v5.2.6) - 2023-01-28 * add support of PHP 8.1 and PHP 8.2 diff --git a/phpunit.xml b/phpunit.xml index 05c421b9..a6603358 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,7 +1,7 @@ 5, 'minor' => 2, - 'revision' => 6 + 'revision' => 7 ); } diff --git a/src/Tests/AbstractTest.php b/src/Tests/AbstractTest.php index aa720444..7f5a24fd 100755 --- a/src/Tests/AbstractTest.php +++ b/src/Tests/AbstractTest.php @@ -3,17 +3,12 @@ namespace Spipu\Html2Pdf\Tests; use Spipu\Html2Pdf\Html2Pdf; - -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once 'CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php'; -} else { - require_once 'CrossVersionCompatibility/PhpUnit5/AbstractTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\AbstractTestCase; /** * Class AbstractTest */ -abstract class AbstractTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\AbstractTestCase +abstract class AbstractTest extends AbstractTestCase { /** * Get the object to test diff --git a/src/Tests/CrossVersionCompatibility/AbstractTestCase.php b/src/Tests/CrossVersionCompatibility/AbstractTestCase.php new file mode 100644 index 00000000..22d0eb3b --- /dev/null +++ b/src/Tests/CrossVersionCompatibility/AbstractTestCase.php @@ -0,0 +1,13 @@ +cssConverter = new CssConverter(); } diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit5/ExceptionFormatterTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit5/ExceptionFormatterTestCase.php index 476d869b..48b935d9 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit5/ExceptionFormatterTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit5/ExceptionFormatterTestCase.php @@ -10,8 +10,10 @@ * @copyright 2017 Laurent MINGUET */ -namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility; +namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility\PhpUnit5; -abstract class ExceptionFormatterTestCase extends \PHPUnit_Framework_TestCase +use PHPUnit_Framework_TestCase; + +abstract class ExceptionFormatterTestCase extends PHPUnit_Framework_TestCase { } diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php index 63723435..54a1fe18 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php @@ -10,11 +10,12 @@ * @copyright 2017 Laurent MINGUET */ -namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility; +namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility\PhpUnit5; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Parsing\Html; -abstract class HtmlTestCase extends \PHPUnit_Framework_TestCase +abstract class HtmlTestCase extends PHPUnit_Framework_TestCase { /** * @var Html diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit5/SvgDrawerTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit5/SvgDrawerTestCase.php index 5ceda58a..ace3da8b 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit5/SvgDrawerTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit5/SvgDrawerTestCase.php @@ -1,18 +1,19 @@ createMock('Spipu\Html2Pdf\MyPdf'); diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit5/TagParserTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit5/TagParserTestCase.php index 4831abde..3d9c6d1e 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit5/TagParserTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit5/TagParserTestCase.php @@ -10,12 +10,12 @@ * @copyright 2017 Laurent MINGUET */ -namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility; +namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility\PhpUnit5; -use Spipu\Html2Pdf\Parsing\Node; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Parsing\TagParser; -abstract class TagParserTestCase extends \PHPUnit_Framework_TestCase +abstract class TagParserTestCase extends PHPUnit_Framework_TestCase { /** * @var TagParser diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit5/TextParserTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit5/TextParserTestCase.php index a447e299..9e60806d 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit5/TextParserTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit5/TextParserTestCase.php @@ -10,11 +10,12 @@ * @copyright 2017 Laurent MINGUET */ -namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility; +namespace Spipu\Html2Pdf\Tests\CrossVersionCompatibility\PhpUnit5; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Parsing\TextParser; -abstract class TextParserTestCase extends \PHPUnit_Framework_TestCase +abstract class TextParserTestCase extends PHPUnit_Framework_TestCase { /** * @var TextParser diff --git a/src/Tests/CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php b/src/Tests/CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php index b59d18ce..5a20ad17 100644 --- a/src/Tests/CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php +++ b/src/Tests/CrossVersionCompatibility/PhpUnit9/AbstractTestCase.php @@ -1,12 +1,13 @@ = 0) { + class PHPUnit_Framework_TestCase extends PHPUnit\Framework\TestCase + { + } + + define('HTML2PDF_PHPUNIT_VERSION', 9); +} else { + define('HTML2PDF_PHPUNIT_VERSION', 5); +} diff --git a/src/Tests/CssConverterTest.php b/src/Tests/CssConverterTest.php index 8a2bc366..06d606e9 100644 --- a/src/Tests/CssConverterTest.php +++ b/src/Tests/CssConverterTest.php @@ -2,16 +2,12 @@ namespace Spipu\Html2Pdf\Tests; -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once 'CrossVersionCompatibility/PhpUnit9/CssConverterTestCase.php'; -} else { - require_once 'CrossVersionCompatibility/PhpUnit5/CssConverterTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\CssConverterTestCase; /** * Class CssConverterTest */ -class CssConverterTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\CssConverterTestCase +class CssConverterTest extends CssConverterTestCase { /** * @param string $css diff --git a/src/Tests/ExamplesTest.php b/src/Tests/ExamplesTest.php index 27729c14..a496bbf7 100644 --- a/src/Tests/ExamplesTest.php +++ b/src/Tests/ExamplesTest.php @@ -12,20 +12,12 @@ namespace Spipu\Html2Pdf\Tests; -if (HTML2PDF_PHPUNIT_VERSION === 9) { - abstract class BaseExamplesTest extends \PHPUnit\Framework\TestCase - { - } -} else { - abstract class BaseExamplesTest extends \PHPUnit_Framework_TestCase - { - } -} +use PHPUnit_Framework_TestCase; /** * Class ExamplesTest */ -class ExamplesTest extends BaseExamplesTest +class ExamplesTest extends PHPUnit_Framework_TestCase { /** * Launch a example diff --git a/src/Tests/Exception/ExceptionFormatterTest.php b/src/Tests/Exception/ExceptionFormatterTest.php index 180832af..10e4f94a 100644 --- a/src/Tests/Exception/ExceptionFormatterTest.php +++ b/src/Tests/Exception/ExceptionFormatterTest.php @@ -17,17 +17,12 @@ use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Exception\ImageException; use Spipu\Html2Pdf\Exception\LongSentenceException; - -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit9/ExceptionFormatterTestCase.php'; -} else { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit5/ExceptionFormatterTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\ExceptionFormatterTestCase; /** * Class ExceptionFormaterTest */ -class ExceptionFormatterTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\ExceptionFormatterTestCase +class ExceptionFormatterTest extends ExceptionFormatterTestCase { /** * Test the formatter / generic exception diff --git a/src/Tests/Exception/LongSentenceExceptionTest.php b/src/Tests/Exception/LongSentenceExceptionTest.php index 960bcd1f..0ae4444a 100644 --- a/src/Tests/Exception/LongSentenceExceptionTest.php +++ b/src/Tests/Exception/LongSentenceExceptionTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Exception; +use Spipu\Html2Pdf\Exception\LongSentenceException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class LongSentenceExceptionTest extends AbstractTest */ public function testBug() { - $this->expectException(\Spipu\Html2Pdf\Exception\LongSentenceException::class); + $this->expectException(LongSentenceException::class); $sentence = 'This is a sentence.'; $bigSentence = $sentence; diff --git a/src/Tests/Html2PdfTest.php b/src/Tests/Html2PdfTest.php index 5ff4ceee..387e850e 100644 --- a/src/Tests/Html2PdfTest.php +++ b/src/Tests/Html2PdfTest.php @@ -2,6 +2,7 @@ namespace Spipu\Html2Pdf\Tests; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tag\AbstractTag; /** @@ -39,8 +40,8 @@ public function testSecurityGood() public function testSecurityKo() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); - $this->expectExceptionMessage('Unauthorized path scheme', \Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); + $this->expectExceptionMessage('Unauthorized path scheme', HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('
'); } diff --git a/src/Tests/Image/BackgroundErrorTest.php b/src/Tests/Image/BackgroundErrorTest.php index 33f40f26..75f33c10 100644 --- a/src/Tests/Image/BackgroundErrorTest.php +++ b/src/Tests/Image/BackgroundErrorTest.php @@ -27,7 +27,7 @@ class BackgroundErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\ImageException::class); + $this->expectException(ImageException::class); $image = '/res/wrong.png'; try { diff --git a/src/Tests/Image/SrcErrorTest.php b/src/Tests/Image/SrcErrorTest.php index 5b88d81b..a407615f 100644 --- a/src/Tests/Image/SrcErrorTest.php +++ b/src/Tests/Image/SrcErrorTest.php @@ -12,7 +12,6 @@ namespace Spipu\Html2Pdf\Tests\Image; -use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Exception\ImageException; use Spipu\Html2Pdf\Tests\AbstractTest; @@ -28,7 +27,7 @@ class SrcErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\ImageException::class); + $this->expectException(ImageException::class); $image = '/res/wrong.png'; try { diff --git a/src/Tests/LocaleTest.php b/src/Tests/LocaleTest.php index 288ab984..fa22f229 100644 --- a/src/Tests/LocaleTest.php +++ b/src/Tests/LocaleTest.php @@ -12,13 +12,14 @@ namespace Spipu\Html2Pdf\Tests; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Locale; use Spipu\Html2Pdf\Exception\LocaleException; /** * Class LocaleTest */ -class LocaleTest extends \PHPUnit_Framework_TestCase +class LocaleTest extends PHPUnit_Framework_TestCase { /** * test bad code @@ -27,7 +28,7 @@ class LocaleTest extends \PHPUnit_Framework_TestCase */ public function testBadCode() { - $this->expectException(\Spipu\Html2Pdf\Exception\LocaleException::class); + $this->expectException(LocaleException::class); Locale::clean(); try { @@ -45,7 +46,7 @@ public function testBadCode() */ public function testUnknownCode() { - $this->expectException(\Spipu\Html2Pdf\Exception\LocaleException::class); + $this->expectException(LocaleException::class); Locale::clean(); try { Locale::load('aa'); diff --git a/src/Tests/Output/FileNameOkTest.php b/src/Tests/Output/FileNameOkTest.php index 6b27c880..9cdda257 100644 --- a/src/Tests/Output/FileNameOkTest.php +++ b/src/Tests/Output/FileNameOkTest.php @@ -12,7 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Output; -use Spipu\Html2Pdf\Html2Pdf; +use Spipu\Html2Pdf\Exception\Html2PdfException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -58,7 +58,7 @@ public function testIgnore() */ public function testError() { - $this->expectException(\Spipu\Html2Pdf\Exception\Html2PdfException::class); + $this->expectException(Html2PdfException::class); $object = $this->getObject(); $object->writeHTML('

Hello World

'); $object->output('test.bad'); diff --git a/src/Tests/Parsing/HtmlLexerTest.php b/src/Tests/Parsing/HtmlLexerTest.php index 01e963ca..a32611b3 100644 --- a/src/Tests/Parsing/HtmlLexerTest.php +++ b/src/Tests/Parsing/HtmlLexerTest.php @@ -12,12 +12,13 @@ namespace Spipu\Html2Pdf\Tests\Parsing; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Parsing\HtmlLexer; /** * Class HtmlLexerTest */ -class HtmlLexerTest extends \PHPUnit_Framework_TestCase +class HtmlLexerTest extends PHPUnit_Framework_TestCase { /** * Test: tokenize diff --git a/src/Tests/Parsing/HtmlTest.php b/src/Tests/Parsing/HtmlTest.php index 762a8af6..1cc7ab67 100644 --- a/src/Tests/Parsing/HtmlTest.php +++ b/src/Tests/Parsing/HtmlTest.php @@ -12,16 +12,12 @@ namespace Spipu\Html2Pdf\Tests\Parsing; -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit9/HtmlTestCase.php'; -} else { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit5/HtmlTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\HtmlTestCase; /** * Class HtmlTest */ -class HtmlTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\HtmlTestCase +class HtmlTest extends HtmlTestCase { /** * mock of prepareTxt method diff --git a/src/Tests/Parsing/ParsingTest.php b/src/Tests/Parsing/ParsingTest.php index 01ac2ea3..31fbd3fd 100644 --- a/src/Tests/Parsing/ParsingTest.php +++ b/src/Tests/Parsing/ParsingTest.php @@ -12,7 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Parsing; -use Spipu\Html2Pdf\Html2Pdf; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -27,7 +27,7 @@ class ParsingTest extends AbstractTest */ public function testUnknownTag() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello World'); $object->output('test.pdf', 'S'); @@ -40,7 +40,7 @@ public function testUnknownTag() */ public function testTooManyClosuresFound() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); @@ -53,7 +53,7 @@ public function testTooManyClosuresFound() */ public function testWrongClosedOrder() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); @@ -66,7 +66,7 @@ public function testWrongClosedOrder() */ public function testNotClosed() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); @@ -79,7 +79,7 @@ public function testNotClosed() */ public function testNotClosedMore() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); @@ -92,7 +92,7 @@ public function testNotClosedMore() */ public function testInvalidCode() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Parsing/TagParserTest.php b/src/Tests/Parsing/TagParserTest.php index e6f29c24..8ab7cce1 100644 --- a/src/Tests/Parsing/TagParserTest.php +++ b/src/Tests/Parsing/TagParserTest.php @@ -12,18 +12,14 @@ namespace Spipu\Html2Pdf\Tests\Parsing; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Parsing\Node; - -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit9/TagParserTestCase.php'; -} else { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit5/TagParserTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\TagParserTestCase; /** * Class TagParserTest */ -class TagParserTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\TagParserTestCase +class TagParserTest extends TagParserTestCase { /** * mock of prepareTxt method @@ -71,7 +67,7 @@ public function tagAttributesProvider() */ public function testAnalyzeTagBadTag() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $this->parser->analyzeTag('test'); } diff --git a/src/Tests/Parsing/TextParserTest.php b/src/Tests/Parsing/TextParserTest.php index 0e2cec51..4f75dc06 100644 --- a/src/Tests/Parsing/TextParserTest.php +++ b/src/Tests/Parsing/TextParserTest.php @@ -12,16 +12,12 @@ namespace Spipu\Html2Pdf\Tests\Parsing; -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit9/TextParserTestCase.php'; -} else { - require_once __DIR__ . '/../CrossVersionCompatibility/PhpUnit5/TextParserTestCase.php'; -} +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\TextParserTestCase; /** * Class TextParserTest */ -class TextParserTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\TextParserTestCase +class TextParserTest extends TextParserTestCase { /** * Test if it works diff --git a/src/Tests/Parsing/TokenTest.php b/src/Tests/Parsing/TokenTest.php index ed1bc783..4df35874 100644 --- a/src/Tests/Parsing/TokenTest.php +++ b/src/Tests/Parsing/TokenTest.php @@ -12,12 +12,13 @@ namespace Spipu\Html2Pdf\Tests\Parsing; +use PHPUnit_Framework_TestCase; use Spipu\Html2Pdf\Parsing\Token; /** * Class TokenTest */ -class TokenTest extends \PHPUnit_Framework_TestCase +class TokenTest extends PHPUnit_Framework_TestCase { /** diff --git a/src/Tests/SvgDrawerTest.php b/src/Tests/SvgDrawerTest.php index 3f951cdb..1f91a502 100644 --- a/src/Tests/SvgDrawerTest.php +++ b/src/Tests/SvgDrawerTest.php @@ -2,23 +2,20 @@ namespace Spipu\Html2Pdf\Tests; -if (HTML2PDF_PHPUNIT_VERSION === 9) { - require_once 'CrossVersionCompatibility/PhpUnit9/SvgDrawerTestCase.php'; -} else { - require_once 'CrossVersionCompatibility/PhpUnit5/SvgDrawerTestCase.php'; -} +use Spipu\Html2Pdf\Exception\HtmlParsingException; +use Spipu\Html2Pdf\Tests\CrossVersionCompatibility\SvgDrawerTestCase; /** * Class SvgDrawerTest */ -class SvgDrawerTest extends \Spipu\Html2Pdf\Tests\CrossVersionCompatibility\SvgDrawerTestCase +class SvgDrawerTest extends SvgDrawerTestCase { /** * Test IsDrawing Exception */ public function testIsDrawingException() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $properties = [ 'x' => 0, 'y' => 0, diff --git a/src/Tests/Tag/DivTest.php b/src/Tests/Tag/DivTest.php index 90bf76b4..d2cfb496 100644 --- a/src/Tests/Tag/DivTest.php +++ b/src/Tests/Tag/DivTest.php @@ -12,7 +12,6 @@ namespace Spipu\Html2Pdf\Tests\Tag; -use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Tests\AbstractTest; /** diff --git a/src/Tests/Tag/MustHaveTagsTest.php b/src/Tests/Tag/MustHaveTagsTest.php index 6e485f6a..90db36ea 100644 --- a/src/Tests/Tag/MustHaveTagsTest.php +++ b/src/Tests/Tag/MustHaveTagsTest.php @@ -12,7 +12,6 @@ namespace Spipu\Html2Pdf\Tests\Tag; -use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Tests\AbstractTest; /** diff --git a/src/Tests/Tag/Svg/CircleErrorTest.php b/src/Tests/Tag/Svg/CircleErrorTest.php index 8d627a75..035108fa 100644 --- a/src/Tests/Tag/Svg/CircleErrorTest.php +++ b/src/Tests/Tag/Svg/CircleErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class CircleErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/EllipseErrorTest.php b/src/Tests/Tag/Svg/EllipseErrorTest.php index 0dff4520..45bf8240 100644 --- a/src/Tests/Tag/Svg/EllipseErrorTest.php +++ b/src/Tests/Tag/Svg/EllipseErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class EllipseErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/GErrorTest.php b/src/Tests/Tag/Svg/GErrorTest.php index 8a5c0c34..e9b669b8 100644 --- a/src/Tests/Tag/Svg/GErrorTest.php +++ b/src/Tests/Tag/Svg/GErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class GErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/LineErrorTest.php b/src/Tests/Tag/Svg/LineErrorTest.php index 748dad2e..01b81194 100644 --- a/src/Tests/Tag/Svg/LineErrorTest.php +++ b/src/Tests/Tag/Svg/LineErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class LineErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/PathErrorTest.php b/src/Tests/Tag/Svg/PathErrorTest.php index 196ca97e..50e97104 100644 --- a/src/Tests/Tag/Svg/PathErrorTest.php +++ b/src/Tests/Tag/Svg/PathErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class PathErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/PathInvalidTest.php b/src/Tests/Tag/Svg/PathInvalidTest.php index 8ea2d5be..3db53a58 100644 --- a/src/Tests/Tag/Svg/PathInvalidTest.php +++ b/src/Tests/Tag/Svg/PathInvalidTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class PathInvalidTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $html = ' diff --git a/src/Tests/Tag/Svg/PolygonErrorTest.php b/src/Tests/Tag/Svg/PolygonErrorTest.php index 360764f7..24e50280 100644 --- a/src/Tests/Tag/Svg/PolygonErrorTest.php +++ b/src/Tests/Tag/Svg/PolygonErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class PolygonErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/PolylineErrorTest.php b/src/Tests/Tag/Svg/PolylineErrorTest.php index 0d17f35a..2966d231 100644 --- a/src/Tests/Tag/Svg/PolylineErrorTest.php +++ b/src/Tests/Tag/Svg/PolylineErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class PolylineErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/Svg/RectErrorTest.php b/src/Tests/Tag/Svg/RectErrorTest.php index 49f2a57d..2fef81aa 100644 --- a/src/Tests/Tag/Svg/RectErrorTest.php +++ b/src/Tests/Tag/Svg/RectErrorTest.php @@ -12,6 +12,7 @@ namespace Spipu\Html2Pdf\Tests\Tag\Svg; +use Spipu\Html2Pdf\Exception\HtmlParsingException; use Spipu\Html2Pdf\Tests\AbstractTest; /** @@ -26,7 +27,7 @@ class RectErrorTest extends AbstractTest */ public function testCase() { - $this->expectException(\Spipu\Html2Pdf\Exception\HtmlParsingException::class); + $this->expectException(HtmlParsingException::class); $object = $this->getObject(); $object->writeHTML(''); $object->output('test.pdf', 'S'); diff --git a/src/Tests/Tag/TdTooLongTest.php b/src/Tests/Tag/TdTooLongTest.php index abb427e7..bff57052 100644 --- a/src/Tests/Tag/TdTooLongTest.php +++ b/src/Tests/Tag/TdTooLongTest.php @@ -12,7 +12,6 @@ namespace Spipu\Html2Pdf\Tests\Tag; -use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Tests\AbstractTest; /** diff --git a/src/Tests/bootstrap.php b/src/Tests/bootstrap.php deleted file mode 100644 index c56643f4..00000000 --- a/src/Tests/bootstrap.php +++ /dev/null @@ -1,12 +0,0 @@ -= 0 -) { - define('HTML2PDF_PHPUNIT_VERSION', 9); - require_once 'CrossVersionCompatibility/PhpUnit9/TestCase.php'; -} else { - define('HTML2PDF_PHPUNIT_VERSION', 5); -}