Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API phpunit 9 support #187

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand All @@ -38,4 +38,4 @@
"license": "BSD-3-Clause",
"minimum-stability": "dev",
"prefer-stable": true
}
}
9 changes: 5 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
<testsuite name="Default">
<directory>tests</directory>
</testsuite>

<testsuites>
<testsuite name="Default">
<directory>tests</directory>
</testsuite>
</testsuites>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
Expand Down
8 changes: 4 additions & 4 deletions tests/WidgetControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class WidgetControllerTest extends FunctionalTest
TestWidget::class,
];

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

Expand All @@ -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"
Expand All @@ -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"
Expand Down