From a49fd98349d546dff4b55ef262938e6550e04c84 Mon Sep 17 00:00:00 2001 From: David Monllao Date: Mon, 21 Dec 2015 16:27:23 +0800 Subject: [PATCH] MDL-52226 tests: Fix behat phpunit naming conflict --- lib/tests/behat/largeforms.feature | 18 +++++++++--------- ..._input_vars_test.php => max_input_vars.php} | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) rename lib/tests/fixtures/{max_input_vars_test.php => max_input_vars.php} (97%) diff --git a/lib/tests/behat/largeforms.feature b/lib/tests/behat/largeforms.feature index f1415ed169b..8fdb7901177 100644 --- a/lib/tests/behat/largeforms.feature +++ b/lib/tests/behat/largeforms.feature @@ -11,7 +11,7 @@ Feature: Forms with a large number of fields | Course 1 | C1 | topics | And the following "activities" exist: | activity | name | intro | course | idnumber | - | label | L1 | FixtureLink | C1 | label1 | + | label | L1 | FixtureLink | C1 | label1 | When I log in as "admin" And I am on site homepage And I follow "Course 1" @@ -23,7 +23,7 @@ Feature: Forms with a large number of fields Scenario: Small form with checkboxes (not using workaround) When I follow "Advanced checkboxes / Small" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -34,7 +34,7 @@ Feature: Forms with a large number of fields Scenario: Medium length form with checkboxes (needs workaround) When I follow "Advanced checkboxes / Below limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -45,7 +45,7 @@ Feature: Forms with a large number of fields Scenario: Exact PHP limit length form with checkboxes (uses workaround but doesn't need it) When I follow "Advanced checkboxes / Exact PHP limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -56,7 +56,7 @@ Feature: Forms with a large number of fields Scenario: Longer than the limit with checkboxes (needs workaround) When I follow "Advanced checkboxes / Above limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -67,7 +67,7 @@ Feature: Forms with a large number of fields Scenario: Small form with array fields (not using workaround) When I follow "Select options / Small" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -78,7 +78,7 @@ Feature: Forms with a large number of fields Scenario: Below limit form with array fields (uses workaround but doesn't need it) When I follow "Select options / Below limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -89,7 +89,7 @@ Feature: Forms with a large number of fields Scenario: Exact PHP limit length form with array fields (uses workaround but doesn't need it) When I follow "Select options / Exact PHP limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" @@ -100,7 +100,7 @@ Feature: Forms with a large number of fields Scenario: Longer than the limit with array fields (needs workaround) When I follow "Select options / Above limit" And I press "Submit here!" - Then I should see "_qf__core_max_input_vars_test_form=1" + Then I should see "_qf__core_max_input_vars_form=1" And I should see "mform_isexpanded_id_general=1" And I should see "arraytest=[13,42]" And I should see "array2test=[13,42]" diff --git a/lib/tests/fixtures/max_input_vars_test.php b/lib/tests/fixtures/max_input_vars.php similarity index 97% rename from lib/tests/fixtures/max_input_vars_test.php rename to lib/tests/fixtures/max_input_vars.php index 8a715a8594f..36d97a2fdd7 100644 --- a/lib/tests/fixtures/max_input_vars_test.php +++ b/lib/tests/fixtures/max_input_vars.php @@ -34,7 +34,7 @@ defined('BEHAT_SITE_RUNNING') || die('Only available on Behat test server'); * @copyright 2015 The Open University * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class core_max_input_vars_test_form extends moodleform { +class core_max_input_vars_form extends moodleform { /** * Form definition. */ @@ -93,7 +93,7 @@ $context = context_system::instance(); $type = optional_param('type', '', PARAM_ALPHA); // Set up the page details. -$PAGE->set_url(new moodle_url('/lib/tests/fixtures/max_input_vars_test.php')); +$PAGE->set_url(new moodle_url('/lib/tests/fixtures/max_input_vars.php')); $PAGE->set_context($context); if ($type) { @@ -117,7 +117,7 @@ if ($type) { $fieldcount = (int)ini_get('max_input_vars') + 100; } - $mform = new core_max_input_vars_test_form('max_input_vars_test.php', + $mform = new core_max_input_vars_form('max_input_vars.php', array('type' => $type, 'fieldcount' => $fieldcount, 'control' => $type[0])); if ($type[0] === 'c') { $data = array(); @@ -222,7 +222,7 @@ foreach (array('c' => 'Advanced checkboxes', 'a' => 'Select options') as $control => $controlname) { foreach (array('s' => 'Small', 'm' => 'Below limit', 'e' => 'Exact PHP limit', 'l' => 'Above limit') as $size => $sizename) { - echo html_writer::tag('li', html_writer::link('max_input_vars_test.php?type=' . + echo html_writer::tag('li', html_writer::link('max_input_vars.php?type=' . $control . $size, $controlname . ' / ' . $sizename)); } }