DEP PHP Support in CMS5

This commit is contained in:
Sabina Talipova 2022-12-13 17:42:43 +13:00
parent bf1a8cb3b2
commit 2b9d9833b3
5 changed files with 15 additions and 16 deletions

View File

@ -80,7 +80,7 @@ class UserDefinedFormAdmin extends LeftAndMain
} }
public function index($request) public function index(HTTPRequest $request): HTTPResponse
{ {
// Don't serve anythign under the main URL. // Don't serve anythign under the main URL.
return $this->httpError(404); return $this->httpError(404);

View File

@ -120,7 +120,7 @@ class EditableMultipleOptionField extends EditableFormField
* @param string $manyMany @deprecated * @param string $manyMany @deprecated
* {@inheritDoc} * {@inheritDoc}
*/ */
public function duplicate($doWrite = true, $manyMany = 'many_many') public function duplicate(bool $doWrite = true, ?array $manyMany = null): static
{ {
$clonedNode = parent::duplicate(true); $clonedNode = parent::duplicate(true);

View File

@ -30,17 +30,17 @@
} }
], ],
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^8.1",
"silverstripe/framework": "^4.10", "silverstripe/framework": "^5",
"silverstripe/cms": "^4.6", "silverstripe/cms": "^5",
"symbiote/silverstripe-gridfieldextensions": "^3.1", "symbiote/silverstripe-gridfieldextensions": "^4",
"silverstripe/segment-field": "^2.2", "silverstripe/segment-field": "^3",
"silverstripe/versioned": "^1.0", "silverstripe/versioned": "^2",
"silverstripe/mimevalidator": "^2.0" "silverstripe/mimevalidator": "^3"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0" "squizlabs/php_codesniffer": "^3"
}, },
"conflict": { "conflict": {
"egulias/email-validator": "^2" "egulias/email-validator": "^2"

View File

@ -37,8 +37,6 @@ class UserDefinedFormControllerTest extends FunctionalTest
{ {
protected static $fixture_file = '../UserFormsTest.yml'; protected static $fixture_file = '../UserFormsTest.yml';
protected static $use_draft_site = true;
protected static $disable_themes = true; protected static $disable_themes = true;
protected function setUp(): void protected function setUp(): void
@ -109,7 +107,7 @@ class UserDefinedFormControllerTest extends FunctionalTest
$this->assertEmailSent('nohtml@example.com', 'no-reply@example.com', 'Email Subject'); $this->assertEmailSent('nohtml@example.com', 'no-reply@example.com', 'Email Subject');
$nohtml = $this->findEmail('nohtml@example.com', 'no-reply@example.com', 'Email Subject'); $nohtml = $this->findEmail('nohtml@example.com', 'no-reply@example.com', 'Email Subject');
$this->assertStringContainsString('Basic Text Field: Basic Value', $nohtml['Content'], 'Email contains no html'); $this->assertStringContainsString('* Basic Value <b>HTML</b>', $nohtml['Content'], 'Email contains no html');
// submitted html tags are not escaped because the email is being sent as text/plain // submitted html tags are not escaped because the email is being sent as text/plain
$value = 'My body text Basic Value <b>HTML</b>'; $value = 'My body text Basic Value <b>HTML</b>';
@ -132,8 +130,8 @@ class UserDefinedFormControllerTest extends FunctionalTest
// check that multiple email addresses are supported in to and from // check that multiple email addresses are supported in to and from
$this->assertEmailSent( $this->assertEmailSent(
'test1@example.com; test2@example.com', 'test1@example.com, test2@example.com',
'test3@example.com; test4@example.com', 'test3@example.com, test4@example.com',
'Test Email' 'Test Email'
); );
} }

View File

@ -83,7 +83,8 @@ class SubmittedFileFieldTest extends SapphireTest
), ),
$this->submittedFile->getFormattedValue()->value $this->submittedFile->getFormattedValue()->value
); );
$this->logOut();
$this->loginWithPermission('CMS_ACCESS_CMSMain'); $this->loginWithPermission('CMS_ACCESS_CMSMain');
$this->assertEquals( $this->assertEquals(
sprintf( sprintf(