From 1fac7b914baf95f4fa2534a0116141e0e307cc2c Mon Sep 17 00:00:00 2001 From: Alexander Melihov Date: Thu, 24 Nov 2016 13:49:44 +0300 Subject: [PATCH] MDL-57137 quiz: Create question category with specified parent category Fix question category generator bug. Now it is possible to specify parent category of subcategory, supply only name of parent category --- lib/tests/behat/behat_data_generators.php | 2 +- question/tests/behat/question_categories.feature | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/tests/behat/behat_data_generators.php b/lib/tests/behat/behat_data_generators.php index 4d7263a2db6..b54e3d6ae6a 100644 --- a/lib/tests/behat/behat_data_generators.php +++ b/lib/tests/behat/behat_data_generators.php @@ -163,7 +163,7 @@ class behat_data_generators extends behat_base { 'question categories' => array( 'datagenerator' => 'question_category', 'required' => array('name', 'contextlevel', 'reference'), - 'switchids' => array('questioncategory' => 'category') + 'switchids' => array('questioncategory' => 'parent') ), 'questions' => array( 'datagenerator' => 'question', diff --git a/question/tests/behat/question_categories.feature b/question/tests/behat/question_categories.feature index 81b3f40f790..220f63d4060 100644 --- a/question/tests/behat/question_categories.feature +++ b/question/tests/behat/question_categories.feature @@ -40,6 +40,7 @@ Feature: A teacher can put questions in categories in the question bank Scenario: A question category can be edited When I navigate to "Categories" node in "Course administration > Question bank" And I click on "Edit" "link" in the "Subcategory" "list_item" + And the field "parent" matches value "   Default for C1" And I set the following fields to these values: | Name | New name | | Category info | I was edited |