Commit 29aa709a authored by Doris Tam's avatar Doris Tam

Bug 1810990: blocktype: plans (incl. create_task(), create_plan())

    - additional: set_owner for creating owners of  artefacts

Change-Id: I44996dd12fb35e338316cb42ec3e6d0c194bbf60
parent 1b5162e8
......@@ -77,7 +77,7 @@ class BehatDataGenerators extends BehatBase {
'institution' => 'text',
'public' => 'bool',
),
'required' => array('name', 'owner'),
'required' => array('name', 'owner')
),
'institutions' => array(
'datagenerator' => 'institution',
......@@ -117,7 +117,7 @@ class BehatDataGenerators extends BehatBase {
'layout' => 'text',
'tags' => 'text',
),
'required' => array('title', 'ownertype', 'ownername'),
'required' => array('title', 'ownertype', 'ownername')
),
'blocks' => array(
'datagenerator' => 'block',
......@@ -130,9 +130,8 @@ class BehatDataGenerators extends BehatBase {
'column' => 'text',
'order' => 'text',*/
'retractable' => 'text',
),
'required' => array('title', 'type', 'page'),
'required' => array('title', 'type', 'page')
),
'collections' => array(
'datagenerator' => 'collection',
......@@ -143,7 +142,7 @@ class BehatDataGenerators extends BehatBase {
'ownername' => 'text',
'pages' => 'text',
),
'required' => array('title', 'ownertype', 'ownername'),
'required' => array('title', 'ownertype', 'ownername')
),
'permissions' => array(
'datagenerator' => 'permission',
......@@ -156,7 +155,7 @@ class BehatDataGenerators extends BehatBase {
'role' => 'text',
'multiplepermissions' => 'bool', // Set to true if wanting to add multiple access rules to a view
),
'required' => array('title', 'accesstype'),
'required' => array('title', 'accesstype')
),
'group memberships' => array(
'datagenerator' => 'group_membership',
......@@ -178,7 +177,7 @@ class BehatDataGenerators extends BehatBase {
'url' => 'text',
'urltext' => 'text',
),
'required' => array('emailtype', 'to', 'subject'),
'required' => array('emailtype', 'to', 'subject')
),
'journals' => array(
'datagenerator' => 'blog',
......@@ -189,7 +188,7 @@ class BehatDataGenerators extends BehatBase {
'description' => 'text',
'tags' => 'text',
),
'required' => array('owner', 'ownertype', 'title'),
'required' => array('owner', 'ownertype', 'title')
),
'journalentries' => array(
'datagenerator' => 'blogpost',
......@@ -202,7 +201,32 @@ class BehatDataGenerators extends BehatBase {
'tags' => 'text',
'draft' => 'bool',
),
'required' => array('owner', 'ownertype', 'title', 'entry'),
'required' => array('owner', 'ownertype', 'title', 'entry')
),
'plans' => array(
'datagenerator' => 'plan',
'available' => array(
'owner' => 'text',
'ownertype' => 'text',
'title' => 'text',
'description' => 'text',
'tags' => 'text',
),
'required' => array('owner', 'ownertype', 'title')
),
'tasks' => array(
'datagenerator' => 'task',
'available' => array(
'owner' => 'text',
'ownertype' => 'text',
'plan' => 'text',
'title' => 'text',
'description' => 'text',
'completiondate' => 'text',
'completed' => 'bool',
'tags' => 'text'
),
'required' => array('owner', 'ownertype', 'plan', 'title', 'completiondate')
),
);
......@@ -216,10 +240,10 @@ class BehatDataGenerators extends BehatBase {
foreach ($record as &$value) {
$value = trim($value);
// Normalise boolean values
if (strtolower($value) == 'on' || $value == '1') {
if (strtolower($value) == 'on' || $value == '1' || $value == 'yes') {
$value = true;
}
else if (strtolower($value) == 'off' || $value == '0') {
else if (strtolower($value) == 'off' || $value == '0' || $value == 'no') {
$value = false;
}
}
......
......@@ -43,6 +43,21 @@ Background:
| UserA | user | Entry Five | This is my entry Five | journal1 | cats,dogs | 0 |
| Group1 | group | Group e1 | This is my group entry | journal2 | | 0 |
And the following "plans" exist:
| owner | ownertype | title | description | tags |
| UserA | user | Plan One | This is my plan one | cats,dogs |
| UserA | user | Plan Two | This is my plan two | cats,dogs |
| Group1 | group | Group Plan | This is my group plan | unicorn |
And the following "tasks" exist:
| owner | ownertype | plan | title | description | completiondate | completed | tags |
| UserA | user | Plan One | Task One| Task One Description | 12/12/19 | no | cats,dogs |
| UserA | user | Plan One | Task Two| Task Two Description | 12/01/19 | yes | cats,dogs |
| UserA | user | Plan Two | Task 2a | Task 2a Description | 12/10/19 | yes | cats,dogs |
| UserA | user | Plan Two | Task 2b | Task 2b Description | 11/05/19 | yes | cats,dogs |
| UserA | user | Plan Two | Task 2c | Task 2c Description | 22/02/19 | yes | cats,dogs |
And the following "blocks" exist:
| title | type | page |retractable | data |
| My text 1 | text | Page UserA_00 | yes | This is some text |
......@@ -64,19 +79,19 @@ Background:
| myfolder | folder | Page UserB_00 | no | dirname=myfolder;attachments=mahara_about.pdf,Image2.png,Image1.jpg,Image3.png,mahara.mp3 |
| my html | html | Page UserB_00 | yes | attachment=test_html.html |
#| my blog | blog | Page One | no | copytype=nocopy;count=5;journaltitle=journal1 |
| my blog | blog | Page One | no | copytype=nocopy;count=5;journaltitle=journal1 |
| my blogpost | blogpost | Page One | no | copytype=nocopy;journaltitle=journal1;entrytitle=Entry Two |
| Comments | comment | Page One | | no configdata |
| PeerAssessmt| peerassessment | Page One | auto | no configdata |
| creativecoms| creativecommons| Page One | no | commercialuse=yes;license=3.0;allowmods=no |
| my nav | navigation | Page Three | no | collection=collection one;copytoall=yes |
| my nav | navigation | Page Two | no | collection=collection one;copytoall=yes |
| my plan | plans | Page Two | no | plans=Plan One,Plan Two;tasksdisplaycount=10 |
| internalm v | internalmedia | Page Three | no | attachment=testvid3.mp4 |
| internalm a | internalmedia | Page Three | no | attachment=mahara.mp3 |
| my pdf | pdf | Page Three | no | attachment=mahara_about.pdf |
# creative commons options for allowmods= yes, no, yeswithsharing
| creativecoms| creativecommons| Page One | no | commercialuse=yes;license=3.0;allowmods=no |
......
Markdown is supported
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