Skip to content

Commit

Permalink
MDL-37046 behat: Coding standards compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Jan 29, 2013
1 parent ff2ec29 commit 9516712
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 17 deletions.
6 changes: 3 additions & 3 deletions admin/tool/behat/lang/en/tool_behat.php
Expand Up @@ -24,10 +24,10 @@

$string['allavailablesteps'] = 'All the available steps definitions';
$string['giveninfo'] = 'Given. Processes to set up the environment';
$string['installinfo'] = 'for installation and tests execution info';
$string['installinfo'] = 'Read {$a} for installation and tests execution info';
$string['moreinfoin'] = 'More info in';
$string['newstepsinfo'] = 'for info about how to add new steps definitions';
$string['newtestsinfo'] = 'for info about how to write new tests';
$string['newstepsinfo'] = 'Read {$a} for info about how to add new steps definitions';
$string['newtestsinfo'] = 'Read {$a} for info about how to write new tests';
$string['nostepsdefinitions'] = 'There aren\'t steps definitions matching this filters';
$string['pluginname'] = 'Acceptance testing';
$string['phpunitenvproblem'] = 'PHPUnit environment problem';
Expand Down
13 changes: 7 additions & 6 deletions admin/tool/behat/locallib.php
Expand Up @@ -298,11 +298,11 @@ public static function is_server_running() {
/**
* Cleans the path returned by get_components_with_tests() to standarize it
*
* {@see tests_finder::get_all_directories_with_tests()} it returns the path including /tests/
* @see tests_finder::get_all_directories_with_tests() it returns the path including /tests/
* @param string $path
* @return string The string without the last /tests part
*/
protected static function clean_path($path) {
protected final static function clean_path($path) {

$path = rtrim($path, DIRECTORY_SEPARATOR);

Expand Down Expand Up @@ -433,8 +433,9 @@ protected static function stop_test_mode() {
* Checks whether test environment is enabled or disabled
*
* To check is the current script is running in the test
* environment {@see tool_behat::is_test_environment_running()}
* environment
*
* @see tool_behat::is_test_environment_running()
* @return bool
*/
public static function is_test_mode_enabled() {
Expand Down Expand Up @@ -481,7 +482,7 @@ public static function are_behat_dependencies_installed() {
*
* @return string
*/
protected static function get_test_filepath() {
protected final static function get_test_filepath() {
global $CFG;

if (self::is_test_environment_running()) {
Expand All @@ -499,7 +500,7 @@ protected static function get_test_filepath() {
*
* @return string
*/
protected static function get_behat_tests_path() {
protected final static function get_behat_tests_path() {
return DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'behat';
}

Expand Down Expand Up @@ -530,7 +531,7 @@ protected static function get_behat_dir() {
* Returns the executable path
* @return string
*/
protected static function get_behat_command() {
protected final static function get_behat_command() {
return 'vendor' . DIRECTORY_SEPARATOR . 'bin' . DIRECTORY_SEPARATOR . 'behat';
}

Expand Down
6 changes: 3 additions & 3 deletions admin/tool/behat/renderer.php
Expand Up @@ -56,9 +56,9 @@ public function render_stepsdefinitions($stepsdefinitions, $form) {
$writestepsurl = tool_behat::$docsurl . '#Adding_steps_definitions';
$writestepslink = html_writer::tag('a', $writestepsurl, array('href' => $writestepsurl, 'target' => '_blank'));
$infos = array(
'Read ' . $installlink . ' ' . get_string('installinfo', 'tool_behat'),
'Read ' . $writetestslink . ' ' . get_string('newtestsinfo', 'tool_behat'),
'Read ' . $writestepslink . ' ' . get_string('newstepsinfo', 'tool_behat')
get_string('installinfo', 'tool_behat', $installlink),
get_string('newtestsinfo', 'tool_behat', $writetestslink),
get_string('newstepsinfo', 'tool_behat', $writestepslink)
);
$html .= $this->output->box_start();
$html .= html_writer::tag('h1', 'Info');
Expand Down
8 changes: 8 additions & 0 deletions admin/tool/behat/tests/tool_behat_test.php
Expand Up @@ -29,6 +29,10 @@

/**
* Allows access to internal methods without exposing them
*
* @package tool_behat
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testable_tool_behat extends tool_behat {

Expand Down Expand Up @@ -58,6 +62,10 @@ public static function get_config_file_contents($prefix, $features, $stepsdefini

/**
* Tool behat tests
*
* @package tool_behat
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class tool_behat_testcase extends advanced_testcase {

Expand Down
6 changes: 2 additions & 4 deletions lib/behat/features/bootstrap/behat_init_context.php
Expand Up @@ -17,8 +17,7 @@
/**
* Contexts initializer class
*
* @package core
* @category behat
* @package tool_behat
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand All @@ -35,8 +34,7 @@
* Renamed from behat FeatureContext class according
* to Moodle coding styles conventions
*
* @package core
* @category behat
* @package tool_behat
* @copyright 2012 David Monllaó
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/setup.php
Expand Up @@ -94,8 +94,8 @@
if (isset($CFG->behat_switchcompletely)) {
$CFG->behat_wwwroot = $CFG->wwwroot;

// Default URL for acceptance testing, only accessible from localhost.
} else if (!isset($CFG->behat_wwwroot)) {
// Default URL for acceptance testing, only accessible from localhost.
$CFG->behat_wwwroot = 'http://localhost:8000';
}

Expand Down

0 comments on commit 9516712

Please sign in to comment.