From 162a9d3d121c520b5bff41c879e5a543917d7475 Mon Sep 17 00:00:00 2001 From: Kevin Kaland <kevin@wizone.solutions> Date: Tue, 28 Apr 2020 21:47:57 +0200 Subject: [PATCH] Issue #3114541 by wizonesolutions: Fix test failures. --- tests/src/Functional/FillPdfSettingsFormTest.php | 5 +++++ tests/src/Functional/PdfParseTest.php | 4 ++-- tests/src/Functional/PdfPopulationTest.php | 6 ++---- tests/src/Functional/PdfWebformPopulationTest.php | 2 +- 4 files changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/src/Functional/FillPdfSettingsFormTest.php b/tests/src/Functional/FillPdfSettingsFormTest.php index 7ac85df..02cf2f7 100644 --- a/tests/src/Functional/FillPdfSettingsFormTest.php +++ b/tests/src/Functional/FillPdfSettingsFormTest.php @@ -27,6 +27,11 @@ class FillPdfSettingsFormTest extends BrowserTestBase { */ protected $strictConfigSchema = FALSE; + /** + * {@inheritdoc} + */ + protected $defaultTheme = 'stark'; + /** * {@inheritdoc} */ diff --git a/tests/src/Functional/PdfParseTest.php b/tests/src/Functional/PdfParseTest.php index b2fa8fb..58f2d3f 100644 --- a/tests/src/Functional/PdfParseTest.php +++ b/tests/src/Functional/PdfParseTest.php @@ -27,7 +27,7 @@ class PdfParseTest extends FillPdfTestBase { $config = $this->config('fillpdf.settings'); if (!FillPdf::checkLocalServiceEndpoint($this->container->get('http_client'), $config)) { - throw new \PHPUnit_Framework_SkippedTestError('FillPDF LocalServer unavailable, so skipping test.'); + $this->markTestSkipped('FillPDF LocalServer unavailable, so skipping test.'); } $this->backendTest($config); @@ -44,7 +44,7 @@ class PdfParseTest extends FillPdfTestBase { $this->configureFillPdf(['backend' => 'pdftk']); if (!FillPdf::checkPdftkPath()) { - throw new \PHPUnit_Framework_SkippedTestError('pdftk not available, so skipping test.'); + $this->markTestSkipped('pdftk not available, so skipping test.'); } $this->backendTest($this->config('fillpdf.settings')); diff --git a/tests/src/Functional/PdfPopulationTest.php b/tests/src/Functional/PdfPopulationTest.php index d46475f..82cb207 100644 --- a/tests/src/Functional/PdfPopulationTest.php +++ b/tests/src/Functional/PdfPopulationTest.php @@ -295,7 +295,6 @@ class PdfPopulationTest extends FillPdfTestBase { /** * Tests PDF population using local service. * - * @throws \PHPUnit_Framework_SkippedTestError * @throws \Behat\Mink\Exception\ResponseTextException * Thrown when test had to be skipped as FillPDF LocalServer is not * available. @@ -310,7 +309,7 @@ class PdfPopulationTest extends FillPdfTestBase { $this->configureLocalServiceBackend(); $config = $this->container->get('config.factory')->get('fillpdf.settings'); if (!FillPdf::checkLocalServiceEndpoint($this->container->get('http_client'), $config)) { - throw new \PHPUnit_Framework_SkippedTestError('FillPDF LocalServer unavailable, so skipping test.'); + $this->markTestSkipped('FillPDF LocalServer unavailable, so skipping test.'); } $this->backendTest(); } @@ -318,7 +317,6 @@ class PdfPopulationTest extends FillPdfTestBase { /** * Tests PDF population using a local install of pdftk. * - * @throws \PHPUnit_Framework_SkippedTestError * @throws \Behat\Mink\Exception\ResponseTextException * Thrown when test had to be skipped as local pdftk install is not * available. @@ -326,7 +324,7 @@ class PdfPopulationTest extends FillPdfTestBase { public function testMergePdftk() { $this->configureFillPdf(['backend' => 'pdftk']); if (!FillPdf::checkPdftkPath()) { - throw new \PHPUnit_Framework_SkippedTestError('pdftk not available, so skipping test.'); + $this->markTestSkipped('pdftk not available, so skipping test.'); } $this->backendTest(); } diff --git a/tests/src/Functional/PdfWebformPopulationTest.php b/tests/src/Functional/PdfWebformPopulationTest.php index b29d246..b6fcb3a 100644 --- a/tests/src/Functional/PdfWebformPopulationTest.php +++ b/tests/src/Functional/PdfWebformPopulationTest.php @@ -42,7 +42,7 @@ class PdfWebformPopulationTest extends FillPdfTestBase { /** * {@inheritdoc} */ - protected function setUp(): void { + protected function setUp() { // @todo: Stop skipping this test when Webform has Drupal 9 support. if (version_compare('9.0.0', \Drupal::VERSION, '>=')) { $this->markTestSkipped('Webform is not yet compatible with Drupal 9, so skipping these tests.'); -- GitLab