Skip to content

Commit

Permalink
Merge pull request #22 from creative-commoners/pulls/1/sapphire-test-…
Browse files Browse the repository at this point in the history
…nine

API phpunit 9 support
  • Loading branch information
Maxime Rainville authored Nov 8, 2021
2 parents 45ad17a + cd87a88 commit e20e445
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@
],
"license": "BSD-3-Clause",
"require": {
"php": "^7.3 || ^8.0",
"silverstripe/framework": "^4.10",
"cwp/cwp": "^2"
},
"require-dev": {
"sminnee/phpunit": "^5.7",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3"
},
"extra": [],
Expand Down
8 changes: 4 additions & 4 deletions tests/Extensions/PdfExportExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class PdfExportExtensionTest extends SapphireTest
],
];

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand All @@ -38,7 +38,7 @@ public function testPdfFilenameWithoutPublicDirectory($publicDir, $expected)

/** @var BasePage|PdfExportExtension $page $page */
$page = $this->objFromFixture(BasePage::class, 'test-page-one');
$this->assertContains($expected, $page->getPdfFilename());
$this->assertStringContainsString($expected, $page->getPdfFilename());
}

/**
Expand All @@ -55,13 +55,13 @@ public function pdfFilenameProvider()
public function testPdfLink()
{
$page = $this->objFromFixture(BasePage::class, 'test-page-one');
$this->assertContains('test-page-one/downloadpdf', $page->PdfLink(), 'Link to download PDF');
$this->assertStringContainsString('test-page-one/downloadpdf', $page->PdfLink(), 'Link to download PDF');
}

public function testHomePagePdfLink()
{
$page = $this->objFromFixture(BasePage::class, 'home-page');
$this->assertContains('home/downloadpdf', $page->PdfLink(), 'Link to download PDF');
$this->assertStringContainsString('home/downloadpdf', $page->PdfLink(), 'Link to download PDF');
}

public function testPdfLinkDisabled()
Expand Down
2 changes: 1 addition & 1 deletion tests/Tasks/CleanupGeneratedPdfDailyTaskTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CleanupGeneratedPdfDailyTaskTest extends SapphireTest
*/
protected $task;

protected function setUp()
protected function setUp(): void
{
parent::setUp();

Expand Down

0 comments on commit e20e445

Please sign in to comment.