Closed olix21 closed 5 years ago
Hello there, I was able to run the tests for older php versions when applying this to your PR :
diff --git Tests/Functional/FunctionalTest.php Tests/Functional/FunctionalTest.php
index f66f1df..89579c7 100644
--- Tests/Functional/FunctionalTest.php
+++ Tests/Functional/FunctionalTest.php
@@ -2,11 +2,15 @@
namespace Ensepar\Html2pdfBundle\Tests\Functional;
+use Ensepar\Html2pdfBundle\Tests\Fixtures\AppKernel;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
class FunctionalTest extends KernelTestCase
{
- protected static $container;
+ public static function getKernelClass()
+ {
+ return 'Ensepar\Html2pdfBundle\Tests\Fixtures\AppKernel';
+ }
/**
* We make sure multiple calls are OK.
@@ -17,7 +21,7 @@ class FunctionalTest extends KernelTestCase
{
static::bootKernel();
- $factory = static::$container->get('html2pdf_factory');
+ $factory = static::$kernel->getContainer()->get('html2pdf_factory');
$pdf1 = $factory->create();
$pdf1->writeHTML("<html><body><p>foo</p></body></html>");
diff --git phpunit.xml.dist phpunit.xml.dist
index 47abff4..4cff6c9 100644
--- phpunit.xml.dist
+++ phpunit.xml.dist
@@ -14,7 +14,7 @@
<php>
<env name="KERNEL_CLASS" value="Ensepar\Html2pdfBundle\Tests\Fixtures\AppKernel" />
- <env name="KERNEL_DIR" value="Tests\Fixtures" />
+ <env name="KERNEL_DIR" value="Tests/Fixtures" />
</php>
<testsuites>
LGTM! I'll merge this along #33 so both of you get credited for the work. Thank you for this!
This PR got cherry picked into the master here : https://github.com/OwlyCode/EnseparHtml2pdfBundle/commit/8d8aeb419ef4d97e2a614a43770bf224c17704d9 (I had to do this so @Taluu's work would get into master too). Thank you for contributing and pushing for this subject to get done!
Great! I close the PR
Based on the work of @taluu.
This PR enables the Symfony >= 4.0 support