@@ -2,15 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace SilverStripe\Siteconfig\Test\Behaviour; |
| 4 | 4 | |
| 5 | -use Behat\Behat\Context\ClosuredContextInterface; |
|
| 6 | -use Behat\Behat\Context\TranslatedContextInterface; |
|
| 7 | 5 | use Behat\Behat\Context\BehatContext; |
| 8 | -use Behat\Behat\Context\Step; |
|
| 9 | -use Behat\Behat\Event\StepEvent; |
|
| 10 | -use Behat\Behat\Exception\PendingException; |
|
| 11 | -use Behat\Mink\Driver\Selenium2Driver; |
|
| 12 | -use Behat\Gherkin\Node\PyStringNode; |
|
| 13 | -use Behat\Gherkin\Node\TableNode; |
|
| 14 | 6 | |
| 15 | 7 | /** |
| 16 | 8 | * Context used to create fixtures in the SilverStripe ORM. |
@@ -31,9 +31,9 @@ discard block |
||
| 31 | 31 | throw new \InvalidArgumentException("Bad theme '$theme'"); |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | - $this->requireDir(BASE_PATH . '/themes'); |
|
| 35 | - $this->requireDir(BASE_PATH . '/themes/' . $theme); |
|
| 36 | - $this->requireDir(BASE_PATH . '/themes/' . $theme . '/templates'); |
|
| 34 | + $this->requireDir(BASE_PATH.'/themes'); |
|
| 35 | + $this->requireDir(BASE_PATH.'/themes/'.$theme); |
|
| 36 | + $this->requireDir(BASE_PATH.'/themes/'.$theme.'/templates'); |
|
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | $this->stepCreateTheme($theme); |
| 54 | - $this->requireFile(BASE_PATH . '/themes/' . $theme . '/templates/' . $template, $content); |
|
| 54 | + $this->requireFile(BASE_PATH.'/themes/'.$theme.'/templates/'.$template, $content); |
|
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | protected function requireFile($filename, $content) |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use SilverStripe\Forms\HiddenField; |
| 9 | 9 | use SilverStripe\Forms\LiteralField; |
| 10 | 10 | use SilverStripe\Forms\Form; |
| 11 | -use SilverStripe\ORM\ValidationException; |
|
| 12 | 11 | use SilverStripe\ORM\ArrayList; |
| 13 | 12 | use SilverStripe\ORM\ValidationResult; |
| 14 | 13 | use SilverStripe\View\ArrayData; |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | public function init() { |
| 58 | 58 | parent::init(); |
| 59 | 59 | if (defined('CMS_DIR')) { |
| 60 | - Requirements::javascript(CMS_DIR . '/client/dist/js/bundle.js'); |
|
| 60 | + Requirements::javascript(CMS_DIR.'/client/dist/js/bundle.js'); |
|
| 61 | 61 | } |
| 62 | 62 | } |
| 63 | 63 | |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | )->setHTMLID('Form_EditForm'); |
| 97 | 97 | $form->setValidationResponseCallback(function(ValidationResult $errors) use ($negotiator, $form) { |
| 98 | 98 | $request = $this->getRequest(); |
| 99 | - if($request->isAjax() && $negotiator) { |
|
| 99 | + if ($request->isAjax() && $negotiator) { |
|
| 100 | 100 | $result = $form->forTemplate(); |
| 101 | 101 | return $negotiator->respond($request, array( |
| 102 | 102 | 'CurrentForm' => function() use($result) { |
@@ -2,9 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace SilverStripe\Siteconfig\Test\Behaviour; |
| 4 | 4 | |
| 5 | -use SilverStripe\BehatExtension\Context\SilverStripeContext; |
|
| 6 | -use SilverStripe\BehatExtension\Context\BasicContext; |
|
| 7 | -use SilverStripe\BehatExtension\Context\LoginContext; |
|
| 8 | 5 | use SilverStripe\BehatExtension\Context\FixtureContext; |
| 9 | 6 | use SilverStripe\Cms\Test\Behaviour; |
| 10 | 7 | use SilverStripe\Core\ClassInfo; |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | // Add extra contexts with more steps |
| 38 | 38 | $this->useContext('ThemeContext', new \SilverStripe\Siteconfig\Test\Behaviour\ThemeContext($parameters)); |
| 39 | - if(!class_exists('SilverStripe\\CMS\\Model\\SiteTree')) { |
|
| 39 | + if (!class_exists('SilverStripe\\CMS\\Model\\SiteTree')) { |
|
| 40 | 40 | return; |
| 41 | 41 | } |
| 42 | 42 | |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | $factory = $fixtureContext->getFixtureFactory(); |
| 45 | 45 | foreach (ClassInfo::subclassesFor('SilverStripe\\CMS\\Model\\SiteTree') as $id => $class) { |
| 46 | 46 | $blueprint = Injector::inst()->create('SilverStripe\\Dev\\FixtureBlueprint', $class); |
| 47 | - $blueprint->addCallback('afterCreate', function ($obj, $identifier, &$data, &$fixtures) { |
|
| 47 | + $blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) { |
|
| 48 | 48 | $obj->publish('Stage', 'Live'); |
| 49 | 49 | }); |
| 50 | 50 | $factory->define($class, $blueprint); |
@@ -148,9 +148,9 @@ |
||
| 148 | 148 | $fields->makeFieldReadonly($titleField); |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | - if (file_exists(BASE_PATH . '/install.php')) { |
|
| 151 | + if (file_exists(BASE_PATH.'/install.php')) { |
|
| 152 | 152 | $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", |
| 153 | - "<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", |
|
| 153 | + "<p class=\"message warning\">"._t("SiteTree.REMOVE_INSTALL_WARNING", |
|
| 154 | 154 | "Warning: You should remove install.php from this SilverStripe install for security reasons.") |
| 155 | 155 | . "</p>"), "Title"); |
| 156 | 156 | } |