diff --git a/composer.json b/composer.json index 7803a75..61e7d97 100644 --- a/composer.json +++ b/composer.json @@ -15,12 +15,12 @@ ], "require": { "silverstripe/vendor-plugin": "^1.0", - "silverstripe/framework": "^4.0", + "silverstripe/framework": "^4.10", "silverstripe/cms": "^4.0", "silverstripe/versioned": "^1.0" }, "require-dev": { - "sminnee/phpunit": "^5.7", + "phpunit/phpunit": "^9.5", "squizlabs/php_codesniffer": "^3.0" }, "extra": { @@ -38,4 +38,4 @@ "license": "BSD-3-Clause", "minimum-stability": "dev", "prefer-stable": true -} \ No newline at end of file +} diff --git a/phpunit.xml.dist b/phpunit.xml.dist index f148411..6470738 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,9 @@ - - tests - - + + + tests + + src/ diff --git a/tests/WidgetControllerTest.php b/tests/WidgetControllerTest.php index cd0c1a1..b2de313 100644 --- a/tests/WidgetControllerTest.php +++ b/tests/WidgetControllerTest.php @@ -15,7 +15,7 @@ class WidgetControllerTest extends FunctionalTest TestWidget::class, ]; - protected function setUp() + protected function setUp(): void { parent::setUp(); @@ -32,7 +32,7 @@ public function testWidgetFormRendering() $response = $this->get($page->URLSegment); $formAction = sprintf('%s/widget/%d/%s', $page->URLSegment, $widget->ID, 'Form'); - $this->assertContains( + $this->assertStringContainsString( $formAction, $response->getBody(), "Widget forms are rendered through WidgetArea templates" @@ -47,12 +47,12 @@ public function testWidgetFormSubmission() $this->get($page->URLSegment); $response = $this->submitForm('Form_Form', null, array('TestValue' => 'Updated')); - $this->assertContains( + $this->assertStringContainsString( 'TestValue: Updated', $response->getBody(), "Form values are submitted to correct widget form" ); - $this->assertContains( + $this->assertStringContainsString( sprintf('Widget ID: %d', $widget->ID), $response->getBody(), "Widget form acts on correct widget, as identified in the URL"