MDL-63620 group: Option to enable group messaging for imported groups
authorJun Pataleta <jun@moodle.com>
Mon, 14 Jan 2019 05:31:23 +0000 (13:31 +0800)
committerJun Pataleta <jun@moodle.com>
Mon, 14 Jan 2019 05:31:23 +0000 (13:31 +0800)
group/import.php
group/tests/behat/groups_import.feature
group/tests/fixtures/groups_import.csv

index 41f8b2a..2f563a2 100644 (file)
@@ -83,7 +83,9 @@ if ($mform_post->is_cancelled()) {
             "groupidnumber" => 1,
             "description" => 1,
             "enrolmentkey" => 1,
-            "groupingname" => 1);
+            "groupingname" => 1,
+            "enablemessaging" => 1,
+        );
 
     // --- get header (field names) ---
     $header = explode($csv_delimiter, array_shift($rawlines));
index 95019f1..12ad501 100644 (file)
@@ -31,6 +31,17 @@ Feature: Importing of groups and groupings
     And I should see "group-id-1-duplicate"
     And I should see "group-noid-1"
     And I should see "group-noid-2"
+    # Group messaging should have been enabled for group-id-1.
+    And I set the field "groups" to "group-id-1"
+    And I press "Edit group settings"
+    And I should see "Yes" in the "Group messaging" "select"
+    And I press "Cancel"
+     # Group messaging should not have been enabled for group-id-2.
+    And I set the field "groups" to "group-id-2"
+    And I press "Edit group settings"
+    And I should see "No" in the "Group messaging" "select"
+    And I press "Cancel"
+    # Check groupings
     And I follow "Groupings"
     And I should see "Grouping-1"
     And I should see "Grouping-2"
index ec5fe44..0bf1fb4 100644 (file)
@@ -1,6 +1,6 @@
-groupname, description, groupidnumber,groupingname
-group-id-1, group-id-1, group-id-1,Grouping-1
-group-id-2, group-id-2, group-id-2,Grouping-2
-group-id-1-duplicate, Duplicate of group-id-1, group-id-1,Grouping-3
-group-noid-1, group-noid-1,,Grouping-3
-group-noid-2, group-noid-2,,Grouping-2
+groupname, description, groupidnumber,groupingname,enablemessaging
+group-id-1, group-id-1, group-id-1,Grouping-1,1
+group-id-2, group-id-2, group-id-2,Grouping-2,0
+group-id-1-duplicate, Duplicate of group-id-1, group-id-1,Grouping-3,0
+group-noid-1, group-noid-1,,Grouping-3,0
+group-noid-2, group-noid-2,,Grouping-2,0