mirror of
https://github.com/silverstripe/silverstripe-widgets
synced 2024-10-22 17:05:54 +02:00
Merge pull request #187 from creative-commoners/pulls/2/sapphire-test-nine
API phpunit 9 support
This commit is contained in:
commit
5aca443a7c
@ -15,12 +15,12 @@
|
|||||||
],
|
],
|
||||||
"require": {
|
"require": {
|
||||||
"silverstripe/vendor-plugin": "^1.0",
|
"silverstripe/vendor-plugin": "^1.0",
|
||||||
"silverstripe/framework": "^4.0",
|
"silverstripe/framework": "^4.10",
|
||||||
"silverstripe/cms": "^4.0",
|
"silverstripe/cms": "^4.0",
|
||||||
"silverstripe/versioned": "^1.0"
|
"silverstripe/versioned": "^1.0"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"sminnee/phpunit": "^5.7",
|
"phpunit/phpunit": "^9.5",
|
||||||
"squizlabs/php_codesniffer": "^3.0"
|
"squizlabs/php_codesniffer": "^3.0"
|
||||||
},
|
},
|
||||||
"extra": {
|
"extra": {
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
|
<phpunit bootstrap="vendor/silverstripe/cms/tests/bootstrap.php" colors="true">
|
||||||
<testsuite name="Default">
|
<testsuites>
|
||||||
<directory>tests</directory>
|
<testsuite name="Default">
|
||||||
</testsuite>
|
<directory>tests</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
<filter>
|
<filter>
|
||||||
<whitelist addUncoveredFilesFromWhitelist="true">
|
<whitelist addUncoveredFilesFromWhitelist="true">
|
||||||
<directory suffix=".php">src/</directory>
|
<directory suffix=".php">src/</directory>
|
||||||
|
@ -15,7 +15,7 @@ class WidgetControllerTest extends FunctionalTest
|
|||||||
TestWidget::class,
|
TestWidget::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
protected function setUp()
|
protected function setUp(): void
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class WidgetControllerTest extends FunctionalTest
|
|||||||
$response = $this->get($page->URLSegment);
|
$response = $this->get($page->URLSegment);
|
||||||
|
|
||||||
$formAction = sprintf('%s/widget/%d/%s', $page->URLSegment, $widget->ID, 'Form');
|
$formAction = sprintf('%s/widget/%d/%s', $page->URLSegment, $widget->ID, 'Form');
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
$formAction,
|
$formAction,
|
||||||
$response->getBody(),
|
$response->getBody(),
|
||||||
"Widget forms are rendered through WidgetArea templates"
|
"Widget forms are rendered through WidgetArea templates"
|
||||||
@ -47,12 +47,12 @@ class WidgetControllerTest extends FunctionalTest
|
|||||||
$this->get($page->URLSegment);
|
$this->get($page->URLSegment);
|
||||||
$response = $this->submitForm('Form_Form', null, array('TestValue' => 'Updated'));
|
$response = $this->submitForm('Form_Form', null, array('TestValue' => 'Updated'));
|
||||||
|
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
'TestValue: Updated',
|
'TestValue: Updated',
|
||||||
$response->getBody(),
|
$response->getBody(),
|
||||||
"Form values are submitted to correct widget form"
|
"Form values are submitted to correct widget form"
|
||||||
);
|
);
|
||||||
$this->assertContains(
|
$this->assertStringContainsString(
|
||||||
sprintf('Widget ID: %d', $widget->ID),
|
sprintf('Widget ID: %d', $widget->ID),
|
||||||
$response->getBody(),
|
$response->getBody(),
|
||||||
"Widget form acts on correct widget, as identified in the URL"
|
"Widget form acts on correct widget, as identified in the URL"
|
||||||
|
Loading…
Reference in New Issue
Block a user