SilverStripe\CMS\Tests\Model\SiteTreeTest
Synopsis
class SiteTreeTest
extends SapphireTest
{
- // members
- protected static string $fixture_file = 'SiteTreeTest.yml';
- protected static array $illegal_extensions = ;
- protected static array $extra_dataobjects = ;
- // methods
- public void reservedSegmentsProvider()
- public void testCreateDefaultpages()
- public void testURLGeneration()
- public void testDisallowedURLGeneration()
- public void testDisallowedChildURLGeneration()
- public void testLegacyResourcesDirValuesHaveIncrementedValueAppended()
- public void testDefaultResourcesDirHasLeadingUnderscoreRemovedAndResourcesIsUsed()
- public void testPublishCopiesToLiveTable()
- public void testPublishDeletedFields()
- public void testParentNodeCachedInMemory()
- public void testParentModelReturnType()
- public void testGetOneFromLive()
- public void testChidrenOfRootAreTopLevelPages()
- public void testCanSaveBlankToHasOneRelations()
- public void testStageStates()
- public void testRestoreToStage()
- public void testNoCascadingDeleteWithoutID()
- public void testGetByLink()
- public void testGetByLinkAbsolute()
- public void testRelativeLink()
- public void testPageLevel()
- public void testAbsoluteLiveLink()
- public void testDuplicateChildrenRetainSort()
- public void testDeleteFromStageOperatesRecursively()
- public void testDeleteFromStageOperatesRecursivelyStrict()
- public void testDuplicate()
- public void testDeleteFromLiveOperatesRecursively()
- public void testUnpublishDoesNotDeleteChildrenWithLooseHierachyOn()
- public void testDeleteFromLiveOperatesRecursivelyStrict()
- public void testReadArchiveDate()
- public void testEditPermissions()
- public void testCanEditWithAccessToAllSections()
- public void testCreatePermissions()
- public void testEditPermissionsOnDraftVsLive()
- public void testCompareVersions()
- public void testAuthorIDAndPublisherIDFilledOutOnPublish()
- public void testLinkShortcodeHandler()
- public void testIsCurrent()
- public void testIsSection()
- public void testURLSegmentReserved()
- public void testURLSegmentAutoUpdate()
- public void testURLSegmentAutoUpdateLocalized()
- public void testValidURLSegmentURLSegmentConflicts()
- public void testValidURLSegmentClassNameConflicts()
- public void testValidURLSegmentControllerConflicts()
- public void testURLSegmentPrioritizesExtensionVotes()
- public void testURLSegmentMultiByte()
- public void testVersionsAreCreated()
- public void testPageTypeClasses()
- public void testAllowedChildrenContainsCoreSubclassesButNotHiddenClass()
- public void testAllowedChildren()
- public array allowedChildrenProvider()
- public void testAllowedChildrenValidation()
- public void testClassDropdown()
- public void testCanBeRoot()
- public void testModifyStatusFlagByInheritance()
- public void testMenuTitleIsUnsetWhenEqualsTitle()
- public void testMetaTagGeneratorDisabling()
- public void testGetBreadcrumbItems()
- public void testMetaTags()
- public void testMetaComponents()
- public void testOrphanedPages()
- public void testArchivedPages()
- public void testCanNot()
- public void testCanPublish()
- public void testLinkExtension()
- public void testGetControllerName()
- public void testGetControllerNameFromConfig()
- public void testGetControllerNameWithUnderscoresIsSupported()
- public void testTreeTitleCache()
- public void testDependentPagesOnUnsavedRecord()
- public void testOnBeforeWriteClearsEmbedShortcodeCache()
Hierarchy
Extends
- SilverStripe\Dev\SapphireTest
Members
protected
- $extra_dataobjects
- $fixture_file
- $illegal_extensions
Methods
public
- allowedChildrenProvider()
- reservedSegmentsProvider()
- testAbsoluteLiveLink()
- testAllowedChildren() — Tests that various types of SiteTree classes will or will not be returned from the allowedChildren method
- testAllowedChildrenContainsCoreSubclassesButNotHiddenClass() — Tests that core subclasses of SiteTree are included in allowedChildren() by default, but not instances of HiddenClass
- testAllowedChildrenValidation()
- testArchivedPages() — Test archived page behaviour
- testAuthorIDAndPublisherIDFilledOutOnPublish()
- testCanBeRoot()
- testCanEditWithAccessToAllSections()
- testCanNot()
- testCanPublish()
- testCanSaveBlankToHasOneRelations()
- testChidrenOfRootAreTopLevelPages()
- testClassDropdown()
- testCompareVersions()
- testCreateDefaultpages()
- testCreatePermissions()
- testDefaultResourcesDirHasLeadingUnderscoreRemovedAndResourcesIsUsed() — For new/configured resources dir values ("_resources"), check that URLSegments have the leading underscore removed
- testDeleteFromLiveOperatesRecursively()
- testDeleteFromLiveOperatesRecursivelyStrict()
- testDeleteFromStageOperatesRecursively()
- testDeleteFromStageOperatesRecursivelyStrict()
- testDependentPagesOnUnsavedRecord()
- testDisallowedChildURLGeneration() — Check if reserved URL's are not appended with a number on a child page It's okay to have a URL like domain.com/my-page/admin as it won't interfere with domain.com/admin
- testDisallowedURLGeneration() — Check if reserved URL's are properly appended with a number at top level
- testDuplicate()
- testDuplicateChildrenRetainSort()
- testEditPermissions()
- testEditPermissionsOnDraftVsLive()
- testGetBreadcrumbItems()
- testGetByLink()
- testGetByLinkAbsolute()
- testGetControllerName() — Test that the controller name for a SiteTree instance can be gathered by appending "Controller" to the SiteTree class name in a PSR-2 compliant manner.
- testGetControllerNameFromConfig() — Test that the controller name for a SiteTree instance can be gathered when set directly via config var
- testGetControllerNameWithUnderscoresIsSupported() — Test that underscored class names (legacy) are still supported (deprecation notice is issued though).
- testGetOneFromLive() — Confirm that DataObject::get_one() gets records from SiteTree_Live
- testIsCurrent()
- testIsSection()
- testLegacyResourcesDirValuesHaveIncrementedValueAppended() — For legacy resources dir values ("resources"), check that URLSegments get a -2 appended
- testLinkExtension() — Test url rewriting extensions
- testLinkShortcodeHandler()
- testMenuTitleIsUnsetWhenEqualsTitle()
- testMetaComponents()
- testMetaTagGeneratorDisabling()
- testMetaTags() — Tests SiteTree::MetaTags Note that this test makes no assumption on the closing of tags (other than <title></title>)
- testModifyStatusFlagByInheritance()
- testNoCascadingDeleteWithoutID()
- testOnBeforeWriteClearsEmbedShortcodeCache()
- testOrphanedPages() — Test that orphaned pages are handled correctly
- testPageLevel()
- testPageTypeClasses()
- testParentModelReturnType()
- testParentNodeCachedInMemory()
- testPublishCopiesToLiveTable() — Test that publication copies data to SiteTree_Live
- testPublishDeletedFields() — Test that field which are set and then cleared are also transferred to the published site.
- testReadArchiveDate() — Simple test to confirm that querying from a particular archive date doesn't throw an error
- testRelativeLink()
- testRestoreToStage() — Test that a page can be completely deleted and restored to the stage site
- testStageStates()
- testTreeTitleCache()
- testURLGeneration() — Test generation of the URLSegment values.
- testURLSegmentAutoUpdate()
- testURLSegmentAutoUpdateLocalized()
- testURLSegmentMultiByte()
- testURLSegmentPrioritizesExtensionVotes()
- testURLSegmentReserved()
- testUnpublishDoesNotDeleteChildrenWithLooseHierachyOn()
- testValidURLSegmentClassNameConflicts()
- testValidURLSegmentControllerConflicts()
- testValidURLSegmentURLSegmentConflicts()
- testVersionsAreCreated()