diff --git a/.travis.yml b/.travis.yml index 17c8f02b..4396c444 100644 --- a/.travis.yml +++ b/.travis.yml @@ -41,7 +41,7 @@ before_script: - php ~/travis-support/travis_setup_selenium.php --if-env BEHAT_TEST - php ~/travis-support/travis_setup_php54_webserver.php --if-env BEHAT_TEST -script: +script: - "if [ \"$BEHAT_TEST\" = \"\" ]; then vendor/bin/phpunit cms/tests; fi" - "if [ \"$BEHAT_TEST\" = \"1\" ]; then vendor/bin/behat @cms; fi" diff --git a/_config.php b/_config.php index 24634c9a..f7b8da81 100644 --- a/_config.php +++ b/_config.php @@ -23,4 +23,4 @@ CMSMenu::remove_menu_item('CMSPageReportsController'); CMSMenu::remove_menu_item('CMSPageAddController'); CMSMenu::remove_menu_item('CMSFileAddController'); -CMSMenu::remove_menu_item("SiteConfigLeftAndMain"); \ No newline at end of file +CMSMenu::remove_menu_item("SiteConfigLeftAndMain"); diff --git a/code/batchactions/CMSBatchActions.php b/code/batchactions/CMSBatchActions.php index df185a5d..9f10e2b6 100644 --- a/code/batchactions/CMSBatchActions.php +++ b/code/batchactions/CMSBatchActions.php @@ -1,7 +1,7 @@ canDelete()) $page->delete(); else $status['error'][$page->ID] = true; - // check to see if the record exists on the live site, + // check to see if the record exists on the live site, // if it doesn't remove the tree node $liveRecord = Versioned::get_one_by_stage( 'SiteTree', 'Live', array( '"SiteTree"."ID"' => $id @@ -166,7 +166,7 @@ class CMSBatchAction_Delete extends CMSBatchAction { /** * Unpublish (delete from live site) items batch action. - * + * * @package cms * @subpackage batchaction * @deprecated since version 4.0 diff --git a/code/controllers/CMSFileAddController.php b/code/controllers/CMSFileAddController.php index c3fb382e..59df9fc5 100644 --- a/code/controllers/CMSFileAddController.php +++ b/code/controllers/CMSFileAddController.php @@ -83,7 +83,7 @@ class CMSFileAddController extends LeftAndMain { asort($exts); $uploadField->Extensions = implode(', ', $exts); - $form = CMSForm::create( + $form = CMSForm::create( $this, 'EditForm', new FieldList( diff --git a/code/controllers/CMSPageAddController.php b/code/controllers/CMSPageAddController.php index 1beb6276..19e2441b 100644 --- a/code/controllers/CMSPageAddController.php +++ b/code/controllers/CMSPageAddController.php @@ -50,7 +50,7 @@ class CMSPageAddController extends CMSPageEditController { new SelectionGroup_Item( 'child', $parentField = new TreeDropdownField( - "ParentID", + "ParentID", "", 'SiteTree', 'ID', @@ -61,8 +61,8 @@ class CMSPageAddController extends CMSPageEditController { ) ), $typeField = new OptionsetField( - "PageType", - sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')), + "PageType", + sprintf($numericLabelTmpl, 2, _t('CMSMain.ChoosePageType', 'Choose page type')), $pageTypes, 'Page' ), @@ -71,7 +71,7 @@ class CMSPageAddController extends CMSPageEditController { sprintf( '

%s

', _t( - 'CMSMain.AddPageRestriction', + 'CMSMain.AddPageRestriction', 'Note: Some page types are not allowed for this selection' ) ) @@ -79,7 +79,7 @@ class CMSPageAddController extends CMSPageEditController { ); $parentField->setSearchFunction(function ($sourceObject, $labelField, $search) { return DataObject::get( - $sourceObject, + $sourceObject, sprintf( "\"MenuTitle\" LIKE '%%%s%%' OR \"Title\" LIKE '%%%s%%'", Convert::raw2sql($search), @@ -88,7 +88,7 @@ class CMSPageAddController extends CMSPageEditController { ); }); - // TODO Re-enable search once it allows for HTML title display, + // TODO Re-enable search once it allows for HTML title display, // see http://open.silverstripe.org/ticket/7455 // $parentField->setShowSearch(true); @@ -114,7 +114,7 @@ class CMSPageAddController extends CMSPageEditController { $this->extend('updatePageOptions', $fields); - $form = CMSForm::create( + $form = CMSForm::create( $this, "AddForm", $fields, $actions )->setHTMLID('Form_AddForm'); $form->setAttribute('data-hints', $this->SiteTreeHints()); @@ -163,7 +163,7 @@ class CMSPageAddController extends CMSPageEditController { $editController->setCurrentPageID($record->ID); Session::set( - "FormInfo.Form_EditForm.formError.message", + "FormInfo.Form_EditForm.formError.message", _t('CMSMain.PageAdded', 'Successfully created page') ); Session::set("FormInfo.Form_EditForm.formError.type", 'good'); diff --git a/code/controllers/CMSPageHistoryController.php b/code/controllers/CMSPageHistoryController.php index eb03eadc..e8a1344b 100644 --- a/code/controllers/CMSPageHistoryController.php +++ b/code/controllers/CMSPageHistoryController.php @@ -63,7 +63,7 @@ class CMSPageHistoryController extends CMSMain { */ public function compare($request) { $form = $this->CompareVersionsForm( - $request->param('VersionID'), + $request->param('VersionID'), $request->param('OtherVersionID') ); @@ -90,11 +90,11 @@ class CMSPageHistoryController extends CMSMain { } /** - * Returns the read only version of the edit form. Detaches all {@link FormAction} + * Returns the read only version of the edit form. Detaches all {@link FormAction} * instances attached since only action relates to revert. * * Permission checking is done at the {@link CMSMain::getEditForm()} level. - * + * * @param int $id ID of the record to show * @param array $fields optional * @param int $versionID @@ -156,7 +156,7 @@ class CMSPageHistoryController extends CMSMain { } } - $fields->addFieldToTab('Root.Main', + $fields->addFieldToTab('Root.Main', new LiteralField('CurrentlyViewingMessage', $this->customise(array( 'Content' => $message, 'Classes' => 'notice' @@ -181,11 +181,11 @@ class CMSPageHistoryController extends CMSMain { /** - * Version select form. Main interface between selecting versions to view + * Version select form. Main interface between selecting versions to view * and comparing multiple versions. - * + * * Because we can reload the page directly to a compare view (history/compare/1/2/3) - * this form has to adapt to those parameters as well. + * this form has to adapt to those parameters as well. * * @return Form */ @@ -246,14 +246,14 @@ class CMSPageHistoryController extends CMSMain { 'doCompare', _t('CMSPageHistoryController.COMPAREVERSIONS','Compare Versions') ), new FormAction( - 'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version') + 'doShowVersion', _t('CMSPageHistoryController.SHOWVERSION','Show Version') ) ); // Use <% if $HelpText %>

$HelpText

<% end_if %> - \ No newline at end of file + diff --git a/tests/behat/behat.yml b/tests/behat/behat.yml index 9f3f6c9a..a5f11a82 100644 --- a/tests/behat/behat.yml +++ b/tests/behat/behat.yml @@ -30,4 +30,4 @@ saucelabs: capabilities: platform: "Windows 2008" browser: "firefox" - version: "15" \ No newline at end of file + version: "15" diff --git a/tests/behat/features/bootstrap/FeatureContext.php b/tests/behat/features/bootstrap/FeatureContext.php index 41a22526..83bae940 100644 --- a/tests/behat/features/bootstrap/FeatureContext.php +++ b/tests/behat/features/bootstrap/FeatureContext.php @@ -47,7 +47,7 @@ class FeatureContext extends \SilverStripe\Framework\Test\Behaviour\FeatureConte $obj->publish('Stage', 'Live'); }); $factory->define($class, $blueprint); - } + } } } diff --git a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php index bd816ae7..55c9e0cb 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/FixtureContext.php @@ -23,8 +23,8 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext /** * Find or create a redirector page and link to another existing page. - * Example: Given a "page" "My Redirect" which redirects to a "page" "Page 1" - * + * Example: Given a "page" "My Redirect" which redirects to a "page" "Page 1" + * * @Given /^(?:(an|a|the) )"(?[^"]+)" "(?[^"]+)" (:?which )?redirects to (?:(an|a|the) )"(?[^"]+)" "(?[^"]+)"$/ */ public function stepCreateRedirectorPage($type, $id, $targetType, $targetId) { @@ -46,17 +46,17 @@ class FixtureContext extends \SilverStripe\BehatExtension\Context\FixtureContext } /** - * + * * Check if the user can edit a page - * - * Example: Then pages should be editable by "Admin" + * + * Example: Then pages should be editable by "Admin" * Then pages should not be editable by "Admin" - * + * * @Then /^pages should( not? |\s*)be editable by "([^"]*)"$/ */ - public function pagesShouldBeEditableBy($negative, $member){ + public function pagesShouldBeEditableBy($negative, $member){ $page = \Page::get()->First(); - + return array( new Step\Given('I am not logged in'), new Step\Given('I am logged in with "' . $member . '" permissions'), diff --git a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php index 004586a7..a034954e 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Cms/Test/Behaviour/ThemeContext.php @@ -26,7 +26,7 @@ class ThemeContext extends BehatContext { /** * Create a test theme - * + * * @Given /^a theme "(?[^"]+)"/ */ public function stepCreateTheme($theme) { @@ -39,7 +39,7 @@ class ThemeContext extends BehatContext { /** * Create a template within a test theme - * + * * @Given /^a template "(?