Merge branch 'MDL-37958_master-fix' of git://github.com/dmonllao/moodle
This commit is contained in:
@@ -4,7 +4,8 @@ Feature: Allowed blocks controls
|
||||
As an admin
|
||||
I need to restrict some blocks to be used in courses
|
||||
|
||||
Background:
|
||||
@javascript
|
||||
Scenario: Blocks can be added with the default permissions
|
||||
Given the following "users" exists:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@asd.com |
|
||||
@@ -14,10 +15,7 @@ Feature: Allowed blocks controls
|
||||
And the following "course enrolments" exists:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
|
||||
@javascript
|
||||
Scenario: Blocks can be added with the default permissions
|
||||
Given I log in as "teacher1"
|
||||
And I log in as "teacher1"
|
||||
And I follow "Course $NASTYSTRING1"
|
||||
And I turn editing mode on
|
||||
When I add the "Course completion status" block
|
||||
@@ -27,7 +25,16 @@ Feature: Allowed blocks controls
|
||||
|
||||
@javascript
|
||||
Scenario: Blocks can not be added when the admin restricts the permissions
|
||||
Given I log in as "admin"
|
||||
Given the following "users" exists:
|
||||
| username | firstname | lastname | email |
|
||||
| teacher1 | Teacher | 1 | teacher1@asd.com |
|
||||
And the following "courses" exists:
|
||||
| fullname | shortname | category |
|
||||
| Course $NASTYSTRING1 | C1 | 0 |
|
||||
And the following "course enrolments" exists:
|
||||
| user | course | role |
|
||||
| teacher1 | C1 | editingteacher |
|
||||
And I log in as "admin"
|
||||
And I set the following system permissions of "Teacher" role:
|
||||
| block/activity_modules:addinstance | Prohibit |
|
||||
And I am on homepage
|
||||
|
||||
@@ -102,6 +102,12 @@ class behat_base extends Behat\MinkExtension\Context\RawMinkContext {
|
||||
if ($selector == 'named') {
|
||||
$exceptiontype = $locator[0];
|
||||
$exceptionlocator = $locator[1];
|
||||
|
||||
// If we are in a @javascript session all contents would be displayed as HTML characters.
|
||||
if (get_class($this->getSession()->getDriver()) === 'Behat\Mink\Driver\Selenium2Driver') {
|
||||
$locator[1] = html_entity_decode($locator[1], ENT_NOQUOTES);
|
||||
}
|
||||
|
||||
} else {
|
||||
$exceptiontype = $selector;
|
||||
$exceptionlocator = $locator;
|
||||
|
||||
@@ -48,16 +48,16 @@ class nasty_strings {
|
||||
* @var array
|
||||
*/
|
||||
protected static $strings = array(
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ @@TEST@@ \\\" \\ , ; : . 日本語 % %% ',
|
||||
'& \' \\" \ \'$@NULL@$ < > & < > @@TEST@@ \\\" \\ , ; : . 日本語 % %% ',
|
||||
'< > & < > & \' \\" \ \\\" \\ , ; : . \'$@NULL@$ @@TEST@@ 日本語 % %% ',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ 日本語 % %%@@TEST@@ \\\" \\ , ; : . ',
|
||||
'< > & < > \\\" \\ , ; : . 日本語& \' \\" \ \'$@NULL@$ @@TEST@@ % %% ',
|
||||
'\' \\" \ \'$@NULL@$ @@TEST@@ < > & < > & \\\" \\ , ; : . 日本語 % %% ',
|
||||
'\\\" \\ , ; : . 日本語 % < > & < > & \' \\" \ \'$@NULL@$ @@TEST@@ %% ',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ 日本語 % %% @@TEST@@ \\\" \\ , ; : . ',
|
||||
'. 日本語& \' \\"< > & < > \\\" \\ , ; : \ \'$@NULL@$ @@TEST@@ % %% ',
|
||||
'& \' \\" \ < > & < > \\\" \\ , ; : . 日本語\'$@NULL@$ @@TEST@@ % %% ',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ @@TEST@@ \\\" \\ , ; : . 日本語% %%',
|
||||
'& \' \\" \ \'$@NULL@$ < > & < > @@TEST@@ \\\" \\ , ; : . 日本語% %%',
|
||||
'< > & < > & \' \\" \ \\\" \\ , ; : . \'$@NULL@$ @@TEST@@ 日本語% %%',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ 日本語% %%@@TEST@@ \. \\" \\ , ; :',
|
||||
'< > & < > \\\" \\ , ; : . 日本語& \' \\" \ \'$@NULL@$ @@TEST@@% %%',
|
||||
'\' \\" \ \'$@NULL@$ @@TEST@@ < > & < > & \\\" \\ , ; : . 日本語% %%',
|
||||
'\\\" \\ , ; : . 日本語% < > & < > & \' \\" \ \'$@NULL@$ @@TEST@@ %%',
|
||||
'< > & < > & \' \\" \ \'$@NULL@$ 日本語% %% @@TEST@@ \\\" \\ . , ; :',
|
||||
'. 日本語& \' \\"< > & < > \\\" \\ , ; : \ \'$@NULL@$ @@TEST@@% %%',
|
||||
'& \' \\" \ < > & < > \\\" \\ , ; : . 日本語\'$@NULL@$ @@TEST@@% %%',
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user