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

DEP PHP Support in CMS5 #693

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
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down
11 changes: 6 additions & 5 deletions tests/php/BlogFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ class BlogFunctionalTest extends FunctionalTest
{
protected static $fixture_file = 'BlogFunctionalTest.yml';

protected static $use_draft_site = true;
maxime-rainville marked this conversation as resolved.
Show resolved Hide resolved

protected function setUp(): void
{
Config::modify()->set(URLSegmentFilter::class, 'default_allow_multibyte', true);
Expand All @@ -23,22 +21,25 @@ protected function setUp(): void

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());
}

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());
Expand Down
8 changes: 4 additions & 4 deletions tests/php/Model/BlogControllerFunctionalTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -23,15 +21,17 @@ protected function setUp(): void

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());
}

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());
Expand Down