From ecc28cb565e2e54854054b0c2c911921d37a8ccc Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 23 Mar 2011 12:15:31 +1300 Subject: [PATCH] MINOR Moved MigrateSiteTreeLinkingTask from 'sapphire' to 'cms' module --- .../tasks/MigrateSiteTreeLinkingTaskTest.php | 80 ------------------- .../tasks/MigrateSiteTreeLinkingTaskTest.yml | 67 ---------------- 2 files changed, 147 deletions(-) delete mode 100755 tests/tasks/MigrateSiteTreeLinkingTaskTest.php delete mode 100755 tests/tasks/MigrateSiteTreeLinkingTaskTest.yml diff --git a/tests/tasks/MigrateSiteTreeLinkingTaskTest.php b/tests/tasks/MigrateSiteTreeLinkingTaskTest.php deleted file mode 100755 index 5f10dab07..000000000 --- a/tests/tasks/MigrateSiteTreeLinkingTaskTest.php +++ /dev/null @@ -1,80 +0,0 @@ -run(null); - - $this->assertEquals ( - "Rewrote 9 link(s) on 5 page(s) to use shortcodes.\n", - ob_get_contents(), - 'Rewritten links are correctly reported' - ); - ob_end_clean(); - - $homeID = $this->idFromFixture('SiteTree', 'home'); - $aboutID = $this->idFromFixture('SiteTree', 'about'); - $staffID = $this->idFromFixture('SiteTree', 'staff'); - $actionID = $this->idFromFixture('SiteTree', 'action'); - $hashID = $this->idFromFixture('SiteTree', 'hash_link'); - - $homeContent = sprintf ( - 'AboutStaffExternal Link', - $aboutID, - $staffID - ); - $aboutContent = sprintf ( - 'HomeStaff', - $homeID, - $staffID - ); - $staffContent = sprintf ( - 'HomeAbout', - $homeID, - $aboutID - ); - $actionContent = sprintf ( - 'Search Form', $homeID - ); - $hashLinkContent = sprintf ( - 'HomeAbout', - $homeID, - $aboutID - ); - - $this->assertEquals ( - $homeContent, - DataObject::get_by_id('SiteTree', $homeID)->Content, - 'HTML URLSegment links are rewritten.' - ); - $this->assertEquals ( - $aboutContent, - DataObject::get_by_id('SiteTree', $aboutID)->Content - ); - $this->assertEquals ( - $staffContent, - DataObject::get_by_id('SiteTree', $staffID)->Content - ); - $this->assertEquals ( - $actionContent, - DataObject::get_by_id('SiteTree', $actionID)->Content, - 'Links to actions on pages are rewritten correctly.' - ); - $this->assertEquals ( - $hashLinkContent, - DataObject::get_by_id('SiteTree', $hashID)->Content, - 'Hash/anchor links are correctly handled.' - ); - } - -} \ No newline at end of file diff --git a/tests/tasks/MigrateSiteTreeLinkingTaskTest.yml b/tests/tasks/MigrateSiteTreeLinkingTaskTest.yml deleted file mode 100755 index 34faf0152..000000000 --- a/tests/tasks/MigrateSiteTreeLinkingTaskTest.yml +++ /dev/null @@ -1,67 +0,0 @@ -SiteTree: - home: - Title: Home Page - URLSegment: home - Content: 'AboutStaffExternal Link' - about: - Title: About Us - URLSegment: about - Content: HomeStaff - staff: - Title: Staff - URLSegment: staff - Content: HomeAbout - Parent: =>SiteTree.about - action: - Title: Action Link - URLSegment: action - Content: Search Form - hash_link: - Title: Hash Link - URLSegment: hash-link - Content: 'HomeAbout' - admin_link: - Title: Admin Link - URLSegment: admin-link - Content: Admin - no_links: - Title: No Links - URLSegment: No Links - -SiteTree_LinkTracking: - home_about: - SiteTreeID: =>SiteTree.home - ChildID: =>SiteTree.about - FieldName: Content - home_staff: - SiteTreeID: =>SiteTree.home - ChildID: =>SiteTree.staff - FieldName: Content - about_home: - SiteTreeID: =>SiteTree.about - ChildID: =>SiteTree.home - FieldName: Content - about_staff: - SiteTreeID: =>SiteTree.about - ChildID: =>SiteTree.staff - FieldName: Content - staff_home: - SiteTreeID: =>SiteTree.staff - ChildID: =>SiteTree.home - FieldName: Content - staff_about: - SiteTreeID: =>SiteTree.staff - ChildID: =>SiteTree.about - FieldName: Content - action_home: - SiteTreeID: =>SiteTree.action - ChildID: =>SiteTree.home - FieldName: Content - hash_link_home: - SiteTreeID: =>SiteTree.hash_link - ChildID: =>SiteTree.home - FieldName: Content - hash_link_about: - SiteTreeID: =>SiteTree.hash_link - ChildID: =>SiteTree.about - FieldName: Content