Commit 95167121 authored by David Monllaó's avatar David Monllaó
Browse files

MDL-37046 behat: Coding standards compliant

parent ff2ec29b
......@@ -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';
......
......@@ -298,11 +298,11 @@ class tool_behat {
/**
* 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);
......@@ -433,8 +433,9 @@ class tool_behat {
* 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() {
......@@ -481,7 +482,7 @@ class tool_behat {
*
* @return string
*/
protected static function get_test_filepath() {
protected final static function get_test_filepath() {
global $CFG;
if (self::is_test_environment_running()) {
......@@ -499,7 +500,7 @@ class tool_behat {
*
* @return string
*/
protected static function get_behat_tests_path() {
protected final static function get_behat_tests_path() {
return DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . 'behat';
}
......@@ -530,7 +531,7 @@ class tool_behat {
* 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';
}
......
......@@ -56,9 +56,9 @@ class tool_behat_renderer extends plugin_renderer_base {
$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');
......
......@@ -29,6 +29,10 @@ require_once($CFG->dirroot.'/' . $CFG->admin .'/tool/behat/locallib.php');
/**
* 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 {
......@@ -58,6 +62,10 @@ class testable_tool_behat extends tool_behat {
/**
* 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 {
......
......@@ -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
*/
......@@ -35,8 +34,7 @@ use Behat\Behat\Context\BehatContext,
* 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
*/
......
......@@ -94,8 +94,8 @@ if (!isset($CFG->wwwroot) or $CFG->wwwroot === 'http://example.com/moodle') {
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';
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment