mirror of
https://github.com/wilr/silverstripe-googlesitemaps.git
synced 2024-10-22 09:05:48 +00:00
BUGFIX: update unit tests for googlesitemap module for 3.0. MINOR: version bump in README
This commit is contained in:
parent
295aba26e6
commit
872fd9b258
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
## Requirements
|
## Requirements
|
||||||
|
|
||||||
* SilverStripe 2.4
|
* SilverStripe 3.0
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
@ -22,5 +22,5 @@ See http://en.wikipedia.org/wiki/Sitemaps for info on this format
|
|||||||
|
|
||||||
## Usage Overview
|
## Usage Overview
|
||||||
|
|
||||||
See docs/en/* for more information about configuring the module.
|
See docs/en for more information about configuring the module.
|
||||||
|
|
||||||
|
@ -102,10 +102,10 @@ class GoogleSitemap extends Controller {
|
|||||||
* Adds DataObjects to the existing DataObjectSet with pages from the
|
* Adds DataObjects to the existing DataObjectSet with pages from the
|
||||||
* site tree
|
* site tree
|
||||||
*
|
*
|
||||||
* @return DataObjectSet
|
* @return ArrayList
|
||||||
*/
|
*/
|
||||||
protected function addRegisteredDataObjects() {
|
protected function addRegisteredDataObjects() {
|
||||||
$output = new DataObjectSet();
|
$output = new ArrayList();
|
||||||
|
|
||||||
foreach(self::$google_sitemap_dataobjects as $index => $className) {
|
foreach(self::$google_sitemap_dataobjects as $index => $className) {
|
||||||
$dataObjectSet = DataObject::get($className);
|
$dataObjectSet = DataObject::get($className);
|
||||||
@ -145,7 +145,7 @@ class GoogleSitemap extends Controller {
|
|||||||
|
|
||||||
$pages = Versioned::get_by_stage('SiteTree', 'Live', $filter);
|
$pages = Versioned::get_by_stage('SiteTree', 'Live', $filter);
|
||||||
|
|
||||||
$newPages = new DataObjectSet();
|
$newPages = new ArrayList();
|
||||||
|
|
||||||
if($pages) {
|
if($pages) {
|
||||||
foreach($pages as $page) {
|
foreach($pages as $page) {
|
||||||
@ -235,6 +235,7 @@ class GoogleSitemap extends Controller {
|
|||||||
function index($url) {
|
function index($url) {
|
||||||
if(self::$enabled) {
|
if(self::$enabled) {
|
||||||
SSViewer::set_source_file_comments(false);
|
SSViewer::set_source_file_comments(false);
|
||||||
|
|
||||||
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
$this->getResponse()->addHeader('Content-Type', 'application/xml; charset="utf-8"');
|
||||||
|
|
||||||
// But we want to still render.
|
// But we want to still render.
|
||||||
|
@ -71,9 +71,8 @@ class GoogleSitemapTest extends FunctionalTest {
|
|||||||
function testDecoratorAddsFields() {
|
function testDecoratorAddsFields() {
|
||||||
$page = $this->objFromFixture('Page', 'Page1');
|
$page = $this->objFromFixture('Page', 'Page1');
|
||||||
|
|
||||||
$fields = $page->getCMSFields();
|
$fields = $page->getSettingsFields();
|
||||||
|
$tab = $fields->fieldByName('Root')->fieldByName('Settings')->fieldByName('GoogleSitemap');
|
||||||
$tab = $fields->fieldByName('Root')->fieldByName('Content')->fieldByName('GoogleSitemap');
|
|
||||||
|
|
||||||
$this->assertInstanceOf('Tab', $tab);
|
$this->assertInstanceOf('Tab', $tab);
|
||||||
$this->assertInstanceOf('DropdownField', $tab->fieldByName('Priority'));
|
$this->assertInstanceOf('DropdownField', $tab->fieldByName('Priority'));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user