Skip to content

Commit

Permalink
Merge pull request #2599 from open-sausages/pulls/4/remove-broken-res…
Browse files Browse the repository at this point in the history
…ource-dir

BUG Remove broken RESOURCES_DIR test
  • Loading branch information
emteknetnz authored Oct 15, 2020
2 parents 726e111 + aaf4fb4 commit c6e0c54
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions tests/php/Model/SiteTreeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,23 +152,14 @@ public function testDisallowedChildURLGeneration($title, $urlSegment)
$this->assertEquals($urlSegment, $page->URLSegment);
}

/**
* Check that explicitly setting a URL segment to the resources dir will rename it to have a -2 suffix
*/
public function testExplicitlyUsingResourcesDirForURLSegment()
{
$page = SiteTree::create(['URLSegment' => RESOURCES_DIR]);
$id = $page->write();
$page = SiteTree::get()->byID($id);
$this->assertSame(RESOURCES_DIR . '-2', $page->URLSegment);
}

/**
* For legacy resources dir values ("resources"), check that URLSegments get a -2 appended
*/
public function testLegacyResourcesDirValuesHaveIncrementedValueAppended()
{
if (RESOURCES_DIR !== 'resources') {
// This test only runs on the CMS build because it doesn't have a `resources-dir` flag on its
// composer.json file
$this->markTestSkipped('This legacy test requires RESOURCES_DIR to be "resources"');
}

Expand All @@ -185,6 +176,8 @@ public function testLegacyResourcesDirValuesHaveIncrementedValueAppended()
public function testDefaultResourcesDirHasLeadingUnderscoreRemovedAndResourcesIsUsed()
{
if (RESOURCES_DIR === 'resources') {
// This test won't runs on the CMS build because it doesn't have a `resources-dir` flag on its
// composer.json file. It will run on the recipe-cms build.
$this->markTestSkipped('This test requires RESOURCES_DIR to be something other than "resources"');
}

Expand Down

0 comments on commit c6e0c54

Please sign in to comment.