Skip to content

Commit

Permalink
Merge pull request #693 from creative-commoners/pulls/4/upgrade-cms5
Browse files Browse the repository at this point in the history
DEP PHP Support in CMS5
  • Loading branch information
Maxime Rainville authored Jan 12, 2023
2 parents 4a51782 + 29f0b39 commit 0f1da8c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 20 deletions.
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;

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

0 comments on commit 0f1da8c

Please sign in to comment.