diff --git a/composer.json b/composer.json index 2db9ced..9943ffe 100644 --- a/composer.json +++ b/composer.json @@ -11,10 +11,11 @@ } ], "require": { + "php": "^7.3 || ^8.0", "silverstripe/cms": "^4.0" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.0" }, "autoload": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b543ea6..ab41986 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,9 @@ - - tests/ - + + + tests/ + + src/ diff --git a/tests/IFramePageTest.php b/tests/IFramePageTest.php index 1d0c461..d56d213 100644 --- a/tests/IFramePageTest.php +++ b/tests/IFramePageTest.php @@ -19,12 +19,12 @@ class IFramePageTest extends SapphireTest $iframe->AutoHeight = 1; $iframe->getClass(); - $this->assertContains('iframepage-height-auto', $iframe->getClass()); + $this->assertStringContainsString('iframepage-height-auto', $iframe->getClass()); $iframe->AutoHeight = 0; $iframe->getClass(); - $this->assertNotContains('iframepage-height-auto', $iframe->getClass()); + $this->assertStringNotContainsString('iframepage-height-auto', $iframe->getClass()); } public function testGetStyle() @@ -33,19 +33,19 @@ class IFramePageTest extends SapphireTest $iframe->FixedHeight = 0; $iframe->getStyle(); - $this->assertContains('height: 800px', $iframe->getStyle(), 'Height defaults to 800 if not set.'); + $this->assertStringContainsString('height: 800px', $iframe->getStyle(), 'Height defaults to 800 if not set.'); $iframe->FixedHeight = 100; $iframe->getStyle(); - $this->assertContains('height: 100px', $iframe->getStyle(), 'Fixed height is settable'); + $this->assertStringContainsString('height: 100px', $iframe->getStyle(), 'Fixed height is settable'); $iframe->AutoWidth = 1; $iframe->FixedWidth = '200'; - $this->assertContains('width: 100%', $iframe->getStyle(), 'Auto width overrides fixed width'); + $this->assertStringContainsString('width: 100%', $iframe->getStyle(), 'Auto width overrides fixed width'); $iframe->AutoWidth = 0; $iframe->FixedWidth = '200'; - $this->assertContains('width: 200px', $iframe->getStyle(), 'Fixed width is settable'); + $this->assertStringContainsString('width: 200px', $iframe->getStyle(), 'Fixed width is settable'); } public function testAllowedUrls() @@ -80,12 +80,12 @@ class IFramePageTest extends SapphireTest foreach ($tests['allowed'] as $url) { $iframe->IFrameURL = $url; $iframe->write(); - $this->assertContains($iframe->IFrameURL, $url); + $this->assertStringContainsString($iframe->IFrameURL, $url); } foreach ($tests['banned'] as $url) { $iframe->IFrameURL = $url; - $this->setExpectedException(ValidationException::class); + $this->expectException(ValidationException::class); $iframe->write(); } }