diff --git a/admin/code/CMSMenu.php b/admin/code/CMSMenu.php index f791d64f8..e6086de0f 100644 --- a/admin/code/CMSMenu.php +++ b/admin/code/CMSMenu.php @@ -108,7 +108,8 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider { * * @return boolean Success */ - public static function add_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, $attributes = null) { + public static function add_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, + $attributes = null) { // If a class is defined, then force the use of that as a code. This helps prevent menu item duplication if($controllerClass) { $code = $controllerClass; @@ -238,7 +239,8 @@ class CMSMenu extends Object implements IteratorAggregate, i18nEntityProvider { * * @return boolean Success */ - public static function replace_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, $attributes = null) { + public static function replace_menu_item($code, $menuTitle, $url, $controllerClass = null, $priority = -1, + $attributes = null) { $item = new CMSMenuItem($menuTitle, $url, $controllerClass, $priority); if($attributes) { diff --git a/core/Object.php b/core/Object.php index 821a17d8a..afa126085 100755 --- a/core/Object.php +++ b/core/Object.php @@ -471,8 +471,10 @@ abstract class Object { /** * Return TRUE if a class has a specified extension. - * This supports backwards-compatible format (static Object::has_extension($requiredExtension)) and new format ($object->has_extension($class, $requiredExtension)) - * @param string $classOrExtension if 1 argument supplied, the class name of the extension to check for; if 2 supplied, the class name to test + * This supports backwards-compatible format (static Object::has_extension($requiredExtension)) + * and new format ($object->has_extension($class, $requiredExtension)) + * @param string $classOrExtension if 1 argument supplied, the class name of the extension to + * check for; if 2 supplied, the class name to test * @param string $requiredExtension used only if 2 arguments supplied */ public static function has_extension($classOrExtension, $requiredExtension = null) { diff --git a/dev/SapphireTestReporter.php b/dev/SapphireTestReporter.php index 602520d0e..33a86755b 100644 --- a/dev/SapphireTestReporter.php +++ b/dev/SapphireTestReporter.php @@ -300,17 +300,17 @@ class SapphireTestReporter implements PHPUnit_Framework_TestListener { } } - /** - * Risky test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.8.0 - */ - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { - // Stub out to support PHPUnit 3.8 - } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } /** * Trys to get the original exception thrown by the test on failure/error diff --git a/dev/SilverStripeListener.php b/dev/SilverStripeListener.php index 6c5c95fe9..7ebb78c11 100644 --- a/dev/SilverStripeListener.php +++ b/dev/SilverStripeListener.php @@ -47,15 +47,15 @@ class SilverStripeListener implements PHPUnit_Framework_TestListener { public function addSkippedTest(PHPUnit_Framework_Test $test, Exception $e, $time) { } - /** - * Risky test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.8.0 - */ - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { - // Stub out to support PHPUnit 3.8 - } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } } diff --git a/dev/TeamCityListener.php b/dev/TeamCityListener.php index 0439742d6..18e38b6d6 100644 --- a/dev/TeamCityListener.php +++ b/dev/TeamCityListener.php @@ -62,15 +62,15 @@ class TeamCityListener implements PHPUnit_Framework_TestListener { echo "##teamcity[testIgnored name='{$class}.{$test->getName()}' message='$message']\n"; } - /** - * Risky test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.8.0 - */ - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { - // Stub out to support PHPUnit 3.8 - } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } } diff --git a/dev/TestListener.php b/dev/TestListener.php index 4c0115004..c94e42f3b 100644 --- a/dev/TestListener.php +++ b/dev/TestListener.php @@ -38,17 +38,17 @@ class SS_TestListener implements PHPUnit_Framework_TestListener { $this->class->tearDownOnce(); } - /** - * Risky test. - * - * @param PHPUnit_Framework_Test $test - * @param Exception $e - * @param float $time - * @since Method available since Release 3.8.0 - */ - public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { - // Stub out to support PHPUnit 3.8 - } + /** + * Risky test. + * + * @param PHPUnit_Framework_Test $test + * @param Exception $e + * @param float $time + * @since Method available since Release 3.8.0 + */ + public function addRiskyTest(PHPUnit_Framework_Test $test, Exception $e, $time) { + // Stub out to support PHPUnit 3.8 + } /** * @param String Classname diff --git a/model/GroupedList.php b/model/GroupedList.php index 50fe7723a..4308440d1 100644 --- a/model/GroupedList.php +++ b/model/GroupedList.php @@ -16,8 +16,8 @@ class GroupedList extends SS_ListDecorator { $result = array(); foreach ($this->list as $item) { - /* if $item is an Object, $index can be a method or a value, - * if $item is an array, $index is used as the index */ + // if $item is an Object, $index can be a method or a value, + // if $item is an array, $index is used as the index $key = is_object($item) ? ($item->hasMethod($index) ? $item->$index() : $item->$index) : $item[$index]; if (array_key_exists($key, $result)) { diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php index 459c8ebb6..8adc08d1e 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsFormsContext.php @@ -131,7 +131,8 @@ class CmsFormsContext extends BehatContext { * * @todo Use an actual DOM parser for more accurate assertions * - * @Given /^"(?P([^"]*))" in the "(?P([^"]*))" HTML field should(?P(?: not)?) be (?P(.*))$/ + * @Given /^"(?P([^"]*))" in the "(?P([^"]*))" HTML field + * should(?P(?: not)?) be (?P(.*))$/ */ public function stepContentInHtmlFieldShouldHaveFormatting($text, $field, $negate, $formatting) { $page = $this->getSession()->getPage(); diff --git a/tests/control/ControllerTest.php b/tests/control/ControllerTest.php index edf87e70c..a50be5af7 100644 --- a/tests/control/ControllerTest.php +++ b/tests/control/ControllerTest.php @@ -238,7 +238,8 @@ class ControllerTest extends FunctionalTest { Controller::join_links("?a=1", "admin/crm", "?b=2", "MyForm?c=3")); // And duplicates are handled nicely - $this->assertEquals("admin/crm?foo=2&bar=3&baz=1", Controller::join_links("admin/crm?foo=1&bar=1&baz=1", "?foo=2&bar=3")); + $this->assertEquals("admin/crm?foo=2&bar=3&baz=1", + Controller::join_links("admin/crm?foo=1&bar=1&baz=1", "?foo=2&bar=3")); $this->assertEquals ( 'admin/action', Controller::join_links('admin/', '/', '/action'), 'Test that multiple slashes are trimmed.' diff --git a/tests/forms/RequirementsTest.php b/tests/forms/RequirementsTest.php index 604bb06a6..3c1e4b4ad 100644 --- a/tests/forms/RequirementsTest.php +++ b/tests/forms/RequirementsTest.php @@ -358,9 +358,12 @@ class RequirementsTest extends SapphireTest { $template = '
My header

Body

'; // The expected outputs - $JsInHead = "\n
My header

Body

"; - $JsInBody = "
My header

Body

"; - $JsAtEnd = "
My header

Body

"; + $JsInHead = "\n
My header

Body

"; + $JsInBody = "
My header

Body

"; + $JsAtEnd = "
My header

Body

"; // Test if the script is before the head tag, not before the body. diff --git a/tests/forms/gridfield/GridFieldSortableHeaderTest.php b/tests/forms/gridfield/GridFieldSortableHeaderTest.php index 79cfca5d8..603185884 100644 --- a/tests/forms/gridfield/GridFieldSortableHeaderTest.php +++ b/tests/forms/gridfield/GridFieldSortableHeaderTest.php @@ -30,11 +30,15 @@ class GridFieldSortableHeaderTest extends SapphireTest { // Check that the output shows name and hat as sortable fields, but not city $this->assertContains('City', $htmlFragment['header']); - $this->assertContains('value="Name" class="action ss-gridfield-sort" id="action_SetOrderName"', $htmlFragment['header']); - $this->assertContains('value="Cheerleader Hat" class="action ss-gridfield-sort" id="action_SetOrderCheerleader-Hat-Colour"', $htmlFragment['header']); + $this->assertContains('value="Name" class="action ss-gridfield-sort" id="action_SetOrderName"', + $htmlFragment['header']); + $this->assertContains( + 'value="Cheerleader Hat" class="action ss-gridfield-sort" id="action_SetOrderCheerleader-Hat-Colour"', + $htmlFragment['header']); // Check inverse of above - $this->assertNotContains('value="City" class="action ss-gridfield-sort" id="action_SetOrderCity"', $htmlFragment['header']); + $this->assertNotContains('value="City" class="action ss-gridfield-sort" id="action_SetOrderCity"', + $htmlFragment['header']); $this->assertNotContains('Name', $htmlFragment['header']); $this->assertNotContains('Cheerleader Hat', $htmlFragment['header']); } @@ -143,4 +147,4 @@ class GridFieldSortableHeaderTest_CheerleaderHat extends DataObject implements T 'Cheerleader' => 'GridFieldSortableHeaderTest_Cheerleader' ); -} \ No newline at end of file +} diff --git a/view/SSViewer.php b/view/SSViewer.php index b5f228280..d5fc9fba1 100644 --- a/view/SSViewer.php +++ b/view/SSViewer.php @@ -742,7 +742,7 @@ class SSViewer { * */ public function __construct($templateList, TemplateParser $parser = null) { - $this->setParser($parser ?: Injector::inst()->get('SSTemplateParser')); + $this->setParser($parser ?: Injector::inst()->get('SSTemplateParser')); // flush template manifest cache if requested if (isset($_GET['flush']) && $_GET['flush'] == 'all') { @@ -1172,7 +1172,7 @@ class SSViewer_FromString extends SSViewer { protected $content; public function __construct($content, TemplateParser $parser = null) { - $this->setParser($parser ?: Injector::inst()->get('SSTemplateParser')); + $this->setParser($parser ?: Injector::inst()->get('SSTemplateParser')); $this->content = $content; }