diff --git a/dev/BehatFixtureFactory.php b/dev/BehatFixtureFactory.php index ab645fe46..f8c98e079 100644 --- a/dev/BehatFixtureFactory.php +++ b/dev/BehatFixtureFactory.php @@ -15,7 +15,7 @@ class BehatFixtureFactory extends \FixtureFactory { $data[$fieldName] = $identifier; break; } - } + } } return parent::createObject($name, $identifier, $data); diff --git a/model/Hierarchy.php b/model/Hierarchy.php index 4228c0a3f..4f5b80b8b 100644 --- a/model/Hierarchy.php +++ b/model/Hierarchy.php @@ -15,7 +15,7 @@ class Hierarchy extends DataExtension { * @var Int */ protected $_cache_numChildren; - + /** * @config * @var integer The lower bounds for the amount of nodes to mark. If set, the logic will expand @@ -115,7 +115,7 @@ class Hierarchy extends DataExtension { if($limitToMarked && $rootCall) { $this->markingFinished($numChildrenMethod); } - + if($nodeCountCallback) { $nodeCountWarning = $nodeCountCallback($this->owner, $this->owner->$numChildrenMethod()); if($nodeCountWarning) return $nodeCountWarning; @@ -158,7 +158,7 @@ class Hierarchy extends DataExtension { } else { $output .= $child->getChildrenAsUL("", $titleEval, $extraArg, $limitToMarked, $childrenMethod, $numChildrenMethod, false, $nodeCountThreshold); - } + } } elseif($child->isTreeOpened()) { // Since we're not loading children, don't mark it as open either $child->markClosed(); @@ -457,7 +457,7 @@ class Hierarchy extends DataExtension { $id = $this->owner->ID; return isset(self::$treeOpened[$baseClass][$id]) ? self::$treeOpened[$baseClass][$id] : false; } - + /** * Get a list of this DataObject's and all it's descendants IDs. * @return int @@ -497,7 +497,7 @@ class Hierarchy extends DataExtension { $this->_cache_children = $result->filterByCallback(function($item) { return $item->canView(); }); - } + } return $this->_cache_children; } @@ -616,7 +616,7 @@ class Hierarchy extends DataExtension { ->exclude('ID', (int)$this->owner->ID); if (!$showAll && $this->owner->db('ShowInMenus')) { $staged = $staged->filter('ShowInMenus', 1); - } + } $this->owner->extend("augmentStageChildren", $staged, $showAll); return $staged; } @@ -642,7 +642,7 @@ class Hierarchy extends DataExtension { 'Versioned.mode' => $onlyDeletedFromStage ? 'stage_unique' : 'stage', 'Versioned.stage' => 'Live' )); - + if(!$showAll) $children = $children->filter('ShowInMenus', 1); return $children; diff --git a/tests/behat/features/bootstrap/FeatureContext.php b/tests/behat/features/bootstrap/FeatureContext.php index 557fcb8f1..bf8568fa3 100644 --- a/tests/behat/features/bootstrap/FeatureContext.php +++ b/tests/behat/features/bootstrap/FeatureContext.php @@ -31,7 +31,7 @@ class FeatureContext extends SilverStripeContext * Initializes context. * Every scenario gets it's own context object. * - * @param array $parameters context parameters (set them up through behat.yml) + * @param array $parameters context parameters (set them up through behat.yml) */ public function __construct(array $parameters) { diff --git a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php index 6c528cf9d..bbc50048a 100644 --- a/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php +++ b/tests/behat/features/bootstrap/SilverStripe/Framework/Test/Behaviour/CmsUiContext.php @@ -246,10 +246,13 @@ class CmsUiContext extends BehatContext public function thePreviewContains($content) { $driver = $this->getSession()->getDriver(); - $driver->switchToIFrame('cms-preview-iframe'); + // TODO Remove once we have native support in Mink and php-webdriver, + // see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI + $origWindowName = $driver->getWebDriverSession()->window_handle(); + $driver->switchToIFrame('cms-preview-iframe'); $this->getMainContext()->assertPageContainsText($content); - $driver->switchToWindow(); + $driver->switchToWindow($origWindowName); } /** @@ -304,10 +307,13 @@ class CmsUiContext extends BehatContext public function thePreviewDoesNotContain($content) { $driver = $this->getSession()->getDriver(); + // TODO Remove once we have native support in Mink and php-webdriver, + // see https://groups.google.com/forum/#!topic/behat/QNhOuGHKEWI + $origWindowName = $driver->getWebDriverSession()->window_handle(); + $driver->switchToIFrame('cms-preview-iframe'); - $this->getMainContext()->assertPageNotContainsText($content); - $driver->switchToWindow(); + $driver->switchToWindow($origWindowName); } /** diff --git a/tests/core/CoreTest.php b/tests/core/CoreTest.php index 05e4312b1..28933b165 100644 --- a/tests/core/CoreTest.php +++ b/tests/core/CoreTest.php @@ -24,17 +24,17 @@ class CoreTest extends SapphireTest { $user = getTempFolderUsername(); // A typical Windows location for where sites are stored on IIS - $this->assertEquals(sys_get_temp_dir() . + $this->assertEquals(sys_get_temp_dir() . '/silverstripe-cacheC--inetpub-wwwroot-silverstripe-test-project/' . $user, getTempFolder('C:\\inetpub\\wwwroot\\silverstripe-test-project')); // A typical Mac OS X location for where sites are stored - $this->assertEquals(sys_get_temp_dir() . + $this->assertEquals(sys_get_temp_dir() . '/silverstripe-cache-Users-joebloggs-Sites-silverstripe-test-project/' . $user, getTempFolder('/Users/joebloggs/Sites/silverstripe-test-project')); // A typical Linux location for where sites are stored - $this->assertEquals(sys_get_temp_dir() .'/silverstripe-cache-var-www-silverstripe-test-project/' . $user, + $this->assertEquals(sys_get_temp_dir() . '/silverstripe-cache-var-www-silverstripe-test-project/' . $user, getTempFolder('/var/www/silverstripe-test-project')); } }