Skip to content

Commit

Permalink
DEP PHP Support in CMS5
Browse files Browse the repository at this point in the history
  • Loading branch information
Sabina Talipova committed Jan 13, 2023
1 parent 70f7275 commit 99dc351
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 11 deletions.
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
],
"license": "BSD-3-Clause",
"require": {
"php": "^7.3 || ^8.0",
"silverstripe/framework": "^4.10",
"cwp/cwp-core": "^2",
"silverstripe/cms": "^4",
"silverstripe/taxonomy": "^2",
"symbiote/silverstripe-gridfieldextensions": "^3.2"
"php": "^8.1",
"silverstripe/framework": "^5",
"cwp/cwp-core": "^3",
"silverstripe/cms": "^5",
"silverstripe/taxonomy": "^3",
"symbiote/silverstripe-gridfieldextensions": "^4"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3",
"cwp/starter-theme": "^2"
"cwp/starter-theme": "^4"
},
"conflict": {
"silverstripe/auditor": "<2.2.1"
Expand Down
10 changes: 7 additions & 3 deletions tests/PageTypes/DatedUpdateHolderControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ public function testSettingDateFiltersInReverseOrderShowsMessage()
/** @var EventHolder $holder */
$holder = $this->objFromFixture(EventHolder::class, 'EventHolder1');

$result = $this->get($holder->Link() . '?from=2018-01-10&to=2018-01-01');
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get($holder->Link() . '?stage=Stage' . '&from=2018-01-10&to=2018-01-01');

$this->assertStringContainsString('Filter has been applied with the dates reversed', $result->getBody());
}
Expand All @@ -43,7 +44,8 @@ public function testSettingFromButNotToDateShowsMessage()
/** @var EventHolder $holder */
$holder = $this->objFromFixture(EventHolder::class, 'EventHolder1');

$result = $this->get($holder->Link() . '?from=2018-01-10');
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get($holder->Link() . '?stage=Stage' . '&from=2018-01-10');

$this->assertStringContainsString('Filtered by a single date', $result->getBody());
}
Expand All @@ -55,7 +57,9 @@ public function testInvalidDateFormat()
}
/** @var EventHolder $holder */
$holder = $this->objFromFixture(EventHolder::class, 'EventHolder1');
$result = $this->get($holder->Link() . '?from=christmas&to=2018-01-10');

$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$result = $this->get($holder->Link() . '?stage=Stage' . '&from=christmas&to=2018-01-10');
$this->assertStringContainsString(htmlentities('Dates must be in "y-MM-dd" format.'), $result->getBody());
}

Expand Down
3 changes: 2 additions & 1 deletion tests/PageTypes/SitemapPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ protected function setUp(): void
*/
public function testSitemapShowsNavigationTitleNotNormalTitle()
{
$response = $this->get('sitemap');
$this->logInWithPermission('VIEW_DRAFT_CONTENT');
$response = $this->get('sitemap?stage=Stage');
$parser = new CSSContentParser($response->getBody());
$elements = $parser->getBySelector('.sitemap li.first .sitemap-link');
$this->assertNotEmpty($elements);
Expand Down

0 comments on commit 99dc351

Please sign in to comment.