DEP PHP Support in CMS5

This commit is contained in:
Sabina Talipova 2022-12-09 15:09:46 +13:00
parent 4a51782360
commit 29f0b39271
3 changed files with 21 additions and 20 deletions

View File

@ -8,19 +8,19 @@
],
"type": "silverstripe-vendormodule",
"require": {
"php": "^7.4 || ^8.0",
"silverstripe/cms": "^4.0",
"silverstripe/lumberjack": "^2.0",
"silverstripe/tagfield": "^2.0",
"silverstripe/assets": "^1.0",
"silverstripe/asset-admin": "^1.0"
"php": "^8.1",
"silverstripe/cms": "^5",
"silverstripe/lumberjack": "^3.0",
"silverstripe/tagfield": "^3.0",
"silverstripe/assets": "^2.0",
"silverstripe/asset-admin": "^2.0"
},
"require-dev": {
"silverstripe/recipe-testing": "^2",
"squizlabs/php_codesniffer": "^3.0",
"silverstripe/widgets": "^2",
"silverstripe/comments": "^3.7",
"silverstripe/content-widget": "^2"
"silverstripe/recipe-testing": "^3",
"squizlabs/php_codesniffer": "^3",
"silverstripe/widgets": "^3",
"silverstripe/comments": "^4",
"silverstripe/content-widget": "^3"
},
"extra": {
"expose": [

View File

@ -11,8 +11,6 @@ class BlogFunctionalTest extends FunctionalTest
{
protected static $fixture_file = 'BlogFunctionalTest.yml';
protected static $use_draft_site = true;
protected function setUp(): void
{
Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true);
@ -23,14 +21,16 @@ class BlogFunctionalTest extends FunctionalTest
public function testBlogWithMultibyteUrl()
{
$result = $this->get(rawurlencode('آبید'));
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get(rawurlencode('آبید') . '?stage=Stage');
$this->assertEquals(200, $result->getStatusCode());
}
public function testMemberProfileWithMultibyteUrlAndName()
{
$result = $this->get(rawurlencode('آبید') . '/profile/' . rawurlencode('عبّاس-آبان'));
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get(rawurlencode('آبید') . '/profile/' . rawurlencode('عبّاس-آبان') . '?stage=Stage');
$this->assertEquals(200, $result->getStatusCode());
$this->assertStringContainsString('My Blog Post', $result->getBody());
@ -38,7 +38,8 @@ class BlogFunctionalTest extends FunctionalTest
public function testMemberProfileWithMultibyteUrlAndEnglishName()
{
$result = $this->get(rawurlencode('آبید') . '/profile/bob-jones');
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get(rawurlencode('آبید') . '/profile/bob-jones' . '?stage=Stage');
$this->assertEquals(200, $result->getStatusCode());
$this->assertStringContainsString('My Blog Post', $result->getBody());

View File

@ -11,8 +11,6 @@ class BlogControllerFunctionalTest extends FunctionalTest
{
protected static $fixture_file = 'BlogControllerFunctionalTest.yml';
protected static $use_draft_site = true;
protected function setUp(): void
{
Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true);
@ -23,7 +21,8 @@ class BlogControllerFunctionalTest extends FunctionalTest
public function testGetCategoriesWithMultibyteUrl()
{
$result = $this->get('my-blog/category/' . rawurlencode('آبید'));
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get('my-blog/category/' . rawurlencode('آبید') . '?stage=Stage');
$this->assertEquals(200, $result->getStatusCode());
$this->assertStringContainsString('آبید', $result->getBody());
@ -31,7 +30,8 @@ class BlogControllerFunctionalTest extends FunctionalTest
public function testGetTagsWithMultibyteUrl()
{
$result = $this->get('my-blog/tag/' . rawurlencode('برتراند'));
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get('my-blog/tag/' . rawurlencode('برتراند') . '?stage=Stage');
$this->assertEquals(200, $result->getStatusCode());
$this->assertStringContainsString('برتراند', $result->getBody());