diff --git a/composer.json b/composer.json index 82baed3..2018dda 100755 --- a/composer.json +++ b/composer.json @@ -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": [ diff --git a/tests/php/BlogFunctionalTest.php b/tests/php/BlogFunctionalTest.php index 505486a..cf9c21c 100644 --- a/tests/php/BlogFunctionalTest.php +++ b/tests/php/BlogFunctionalTest.php @@ -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()); diff --git a/tests/php/Model/BlogControllerFunctionalTest.php b/tests/php/Model/BlogControllerFunctionalTest.php index 39385a6..27fe9af 100644 --- a/tests/php/Model/BlogControllerFunctionalTest.php +++ b/tests/php/Model/BlogControllerFunctionalTest.php @@ -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());