Permalink
Browse files

Fixed coding conventions (no functional changes)

Both Symfony and SilverStripe conventions mandate
lower camel case for instance properties
  • Loading branch information...
1 parent f6d56e8 commit 74e0d8cd83280fc71b2f848364d442f8318a9aad @chillu chillu committed Nov 15, 2012
@@ -35,10 +35,10 @@ public function process(ContainerBuilder $container)
if (!$container->hasParameter('behat.mink.base_url')) {
throw new \Exception('MinkExtension improperly configured. Missing base_url parameter.');
}
- $base_url = $container->getParameter('behat.mink.base_url');
- if (empty($base_url)) {
+ $baseUrl = $container->getParameter('behat.mink.base_url');
+ if (empty($baseUrl)) {
throw new \Exception('MinkExtension improperly configured. Missing or empty base_url parameter.');
}
- $container->setParameter('behat.silverstripe_extension.framework_host', $base_url);
+ $container->setParameter('behat.silverstripe_extension.framework_host', $baseUrl);
}
}
@@ -107,10 +107,10 @@ public function readErrorHandlerAfterStep(StepEvent $event)
*/
public function handleAjaxBeforeStep(StepEvent $event)
{
- $ajax_enabled_steps = $this->getMainContext()->getAjaxSteps();
- $ajax_enabled_steps = implode('|', array_filter($ajax_enabled_steps));
+ $ajaxEnabledSteps = $this->getMainContext()->getAjaxSteps();
+ $ajaxEnabledSteps = implode('|', array_filter($ajaxEnabledSteps));
- if (empty($ajax_enabled_steps) || !preg_match('/(' . $ajax_enabled_steps . ')/i', $event->getStep()->getText())) {
+ if (empty($ajaxEnabledSteps) || !preg_match('/(' . $ajaxEnabledSteps . ')/i', $event->getStep()->getText())) {
return;
}
@@ -150,10 +150,10 @@ public function handleAjaxBeforeStep(StepEvent $event)
*/
public function handleAjaxAfterStep(StepEvent $event)
{
- $ajax_enabled_steps = $this->getMainContext()->getAjaxSteps();
- $ajax_enabled_steps = implode('|', array_filter($ajax_enabled_steps));
+ $ajaxEnabledSteps = $this->getMainContext()->getAjaxSteps();
+ $ajaxEnabledSteps = implode('|', array_filter($ajaxEnabledSteps));
- if (empty($ajax_enabled_steps) || !preg_match('/(' . $ajax_enabled_steps . ')/i', $event->getStep()->getText())) {
+ if (empty($ajaxEnabledSteps) || !preg_match('/(' . $ajaxEnabledSteps . ')/i', $event->getStep()->getText())) {
return;
}
@@ -205,7 +205,7 @@ public function takeScreenshot(StepEvent $event) {
$parent = $event->getLogicalParent();
$feature = $parent->getFeature();
$step = $event->getStep();
- $screenshot_path = null;
+ $screenshotPath = null;
$path = $this->getMainContext()->getScreenshotPath();
if(!$path) return; // quit silently when path is not set
@@ -267,10 +267,10 @@ public function stepIPressTheButton($button)
{
$page = $this->getSession()->getPage();
- $button_element = $page->find('named', array('link_or_button', "'$button'"));
- assertNotNull($button_element, sprintf('%s button not found', $button));
+ $buttonElement = $page->find('named', array('link_or_button', "'$button'"));
+ assertNotNull($buttonElement, sprintf('%s button not found', $button));
- $button_element->click();
+ $buttonElement->click();
}
/**
@@ -280,10 +280,10 @@ public function iClickInTheElement($text, $selector)
{
$page = $this->getSession()->getPage();
- $parent_element = $page->find('css', $selector);
- assertNotNull($parent_element, sprintf('"%s" element not found', $selector));
+ $parentElement = $page->find('css', $selector);
+ assertNotNull($parentElement, sprintf('"%s" element not found', $selector));
- $element = $parent_element->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
+ $element = $parentElement->find('xpath', sprintf('//*[count(*)=0 and contains(.,"%s")]', $text));
assertNotNull($element, sprintf('"%s" not found', $text));
$element->click();
@@ -25,7 +25,7 @@
class SilverStripeAwareInitializer implements InitializerInterface
{
- private $database_name;
+ private $databaseName;
/**
* @var Array
@@ -55,10 +55,10 @@ class SilverStripeAwareInitializer implements InitializerInterface
/**
* Initializes initializer.
*/
- public function __construct($framework_path, $framework_host)
+ public function __construct($frameworkPath, $frameworkHost)
{
- $this->bootstrap($framework_path, $framework_host);
- $this->database_name = $this->initializeTempDb();
+ $this->bootstrap($frameworkPath, $frameworkHost);
+ $this->databaseName = $this->initializeTempDb();
}
public function __destruct()
@@ -85,7 +85,7 @@ public function supports(ContextInterface $context)
*/
public function initialize(ContextInterface $context)
{
- $context->setDatabase($this->database_name);
+ $context->setDatabase($this->databaseName);
$context->setAjaxSteps($this->ajaxSteps);
$context->setAjaxTimeout($this->ajaxTimeout);
$context->setScreenshotPath($this->screenshotPath);
@@ -143,17 +143,17 @@ public function getScreenshotPath()
return $this->screenshotPath;
}
- protected function bootstrap($framework_path, $framework_host)
+ protected function bootstrap($frameworkPath, $frameworkHost)
{
file_put_contents('php://stderr', 'Bootstrapping' . PHP_EOL);
// Set file to URL mappings
global $_FILE_TO_URL_MAPPING;
- $_FILE_TO_URL_MAPPING[dirname($framework_path)] = $framework_host;
+ $_FILE_TO_URL_MAPPING[dirname($frameworkPath)] = $frameworkHost;
// Connect to database and build manifest
$_GET['flush'] = 1;
- require_once $framework_path . '/core/Core.php';
+ require_once $frameworkPath . '/core/Core.php';
unset($_GET['flush']);
// Remove the error handler so that PHPUnit can add its own
@@ -54,14 +54,14 @@ public function getSession($name = null)
public function stepIAmLoggedIn()
{
$c = $this->getMainContext();
- $admin_url = $c->joinUrlParts($c->getBaseUrl(), $c->getAdminUrl());
- $login_url = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
+ $adminUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getAdminUrl());
+ $loginUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
- $this->getSession()->visit($admin_url);
+ $this->getSession()->visit($adminUrl);
- if (0 == strpos($this->getSession()->getCurrentUrl(), $login_url)) {
+ if (0 == strpos($this->getSession()->getCurrentUrl(), $loginUrl)) {
$this->stepILogInWith('admin', 'password');
- assertStringStartsWith($admin_url, $this->getSession()->getCurrentUrl());
+ assertStringStartsWith($adminUrl, $this->getSession()->getCurrentUrl());
}
}
@@ -113,17 +113,17 @@ public function stepIAmNotLoggedIn()
public function stepILogInWith($email, $password)
{
$c = $this->getMainContext();
- $login_url = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
+ $loginUrl = $c->joinUrlParts($c->getBaseUrl(), $c->getLoginUrl());
- $this->getSession()->visit($login_url);
+ $this->getSession()->visit($loginUrl);
$page = $this->getSession()->getPage();
- $email_field = $page->find('css', '[name=Email]');
- $password_field = $page->find('css', '[name=Password]');
+ $emailField = $page->find('css', '[name=Email]');
+ $passwordField = $page->find('css', '[name=Password]');
$submit_button = $page->find('css', '[type=submit]');
- $email_field->setValue($email);
- $password_field->setValue($password);
+ $emailField->setValue($email);
+ $passwordField->setValue($password);
$submit_button->press();
}
@@ -134,8 +134,8 @@ public function stepIShouldSeeALogInForm()
{
$page = $this->getSession()->getPage();
- $login_form = $page->find('css', '#MemberLoginForm_LoginForm');
- assertNotNull($login_form, 'I should see a log-in form');
+ $loginForm = $page->find('css', '#MemberLoginForm_LoginForm');
+ assertNotNull($loginForm, 'I should see a log-in form');
}
/**
@@ -145,8 +145,8 @@ public function stepIWillSeeABadLogInMessage()
{
$page = $this->getSession()->getPage();
- $bad_message = $page->find('css', '.message.bad');
+ $badMessage = $page->find('css', '.message.bad');
- assertNotNull($bad_message, 'Bad message not found.');
+ assertNotNull($badMessage, 'Bad message not found.');
}
}
@@ -23,12 +23,12 @@
*
* @param String $database_name Temp database name
*/
- public function setDatabase($database_name);
+ public function setDatabase($databaseName);
/**
* Marks steps as AJAX steps for special treatment
*
* @param array $ajax_steps Array of step name parts to match
*/
- public function setAjaxSteps($ajax_steps);
+ public function setAjaxSteps($ajaxSteps);
}
Oops, something went wrong.

0 comments on commit 74e0d8c

Please sign in to comment.