@@ -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 |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | |
34 | 34 | // Add extra contexts with more steps |
35 | 35 | $this->useContext('ThemeContext', new \SilverStripe\Siteconfig\Test\Behaviour\ThemeContext($parameters)); |
36 | - if(!class_exists('SiteTree')) { |
|
36 | + if (!class_exists('SiteTree')) { |
|
37 | 37 | return; |
38 | 38 | } |
39 | 39 | |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | $factory = $fixtureContext->getFixtureFactory(); |
42 | 42 | foreach (\ClassInfo::subclassesFor('SiteTree') as $id => $class) { |
43 | 43 | $blueprint = \Injector::inst()->create('FixtureBlueprint', $class); |
44 | - $blueprint->addCallback('afterCreate', function ($obj, $identifier, &$data, &$fixtures) { |
|
44 | + $blueprint->addCallback('afterCreate', function($obj, $identifier, &$data, &$fixtures) { |
|
45 | 45 | $obj->publish('Stage', 'Live'); |
46 | 46 | }); |
47 | 47 | $factory->define($class, $blueprint); |
@@ -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) |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | )->setHTMLID('Form_EditForm'); |
71 | 71 | $form->setValidationResponseCallback(function() use ($negotiator, $form) { |
72 | 72 | $request = $this->getRequest(); |
73 | - if($request->isAjax() && $negotiator) { |
|
73 | + if ($request->isAjax() && $negotiator) { |
|
74 | 74 | $form->setupFormErrors(); |
75 | 75 | $result = $form->forTemplate(); |
76 | 76 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | |
129 | 129 | try { |
130 | 130 | $siteConfig->write(); |
131 | - } catch(ValidationException $ex) { |
|
131 | + } catch (ValidationException $ex) { |
|
132 | 132 | $form->sessionMessage($ex->getResult()->message(), 'bad'); |
133 | 133 | return $this->getResponseNegotiator()->respond($this->request); |
134 | 134 | } |
@@ -141,9 +141,9 @@ discard block |
||
141 | 141 | $fields->makeFieldReadonly($titleField); |
142 | 142 | } |
143 | 143 | |
144 | - if (file_exists(BASE_PATH . '/install.php')) { |
|
144 | + if (file_exists(BASE_PATH.'/install.php')) { |
|
145 | 145 | $fields->addFieldToTab("Root.Main", new LiteralField("InstallWarningHeader", |
146 | - "<p class=\"message warning\">" . _t("SiteTree.REMOVE_INSTALL_WARNING", |
|
146 | + "<p class=\"message warning\">"._t("SiteTree.REMOVE_INSTALL_WARNING", |
|
147 | 147 | "Warning: You should remove install.php from this SilverStripe install for security reasons.") |
148 | 148 | . "</p>"), "Title"); |
149 | 149 | } |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | public function getAvailableThemes($baseDir = null) |
166 | 166 | { |
167 | 167 | $themes = SSViewer::get_themes($baseDir); |
168 | - $disabled = (array)$this->config()->disabled_themes; |
|
168 | + $disabled = (array) $this->config()->disabled_themes; |
|
169 | 169 | |
170 | 170 | foreach ($disabled as $theme) { |
171 | 171 | if (isset($themes[$theme])) { |
@@ -26,16 +26,16 @@ |
||
26 | 26 | { |
27 | 27 | $config = $this->objFromFixture('SiteConfig', 'default'); |
28 | 28 | $ds = DIRECTORY_SEPARATOR; |
29 | - $testThemeBaseDir = TEMP_FOLDER . $ds . 'test-themes'; |
|
29 | + $testThemeBaseDir = TEMP_FOLDER.$ds.'test-themes'; |
|
30 | 30 | |
31 | 31 | if (file_exists($testThemeBaseDir)) { |
32 | 32 | Filesystem::removeFolder($testThemeBaseDir); |
33 | 33 | } |
34 | 34 | mkdir($testThemeBaseDir); |
35 | - mkdir($testThemeBaseDir . $ds . 'blackcandy'); |
|
36 | - mkdir($testThemeBaseDir . $ds . 'blackcandy_blog'); |
|
37 | - mkdir($testThemeBaseDir . $ds . 'darkshades'); |
|
38 | - mkdir($testThemeBaseDir . $ds . 'darkshades_blog'); |
|
35 | + mkdir($testThemeBaseDir.$ds.'blackcandy'); |
|
36 | + mkdir($testThemeBaseDir.$ds.'blackcandy_blog'); |
|
37 | + mkdir($testThemeBaseDir.$ds.'darkshades'); |
|
38 | + mkdir($testThemeBaseDir.$ds.'darkshades_blog'); |
|
39 | 39 | |
40 | 40 | $themes = $config->getAvailableThemes($testThemeBaseDir); |
41 | 41 | $this->assertContains('blackcandy', $themes, 'Test themes contain blackcandy theme'); |