Merge branch 'MDL-37958_master-fix' of git://github.com/dmonllao/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2013-03-06 10:31:20 +01:00
3 changed files with 29 additions and 16 deletions
@@ -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
+6
View File
@@ -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;
+10 -10
View File
@@ -48,16 +48,16 @@ class nasty_strings {
* @var array
*/
protected static $strings = array(
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ @@TEST@@ \\\" \\ , ; : .  日本語 ­ % %% ',
'&amp; \' \\" \ \'$@NULL@$ < > & &lt; &gt; @@TEST@@ \\\" \\ , ; : .  日本語 ­ % %% ',
'< > & &lt; &gt; &amp; \' \\" \ \\\" \\ , ; : .  \'$@NULL@$ @@TEST@@ 日本語 ­ % %% ',
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ 日本語 ­ % %%@@TEST@@ \\\" \\ , ; : .  ',
'< > & &lt; &gt; \\\" \\ , ; : .  日本語&amp; \' \\" \ \'$@NULL@$ @@TEST@@ ­ % %% ',
'\' \\" \ \'$@NULL@$ @@TEST@@ < > & &lt; &gt; &amp; \\\" \\ , ; : .  日本語 ­ % %% ',
'\\\" \\ , ; : .  日本語 ­ % < > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ @@TEST@@ %% ',
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ 日本語 ­ % %% @@TEST@@ \\\" \\ , ; : .  ',
'.  日本語&amp; \' \\"< > & &lt; &gt; \\\" \\ , ; : \ \'$@NULL@$ @@TEST@@ ­ % %% ',
'&amp; \' \\" \ < > & &lt; &gt; \\\" \\ , ; : .  日本語\'$@NULL@$ @@TEST@@ ­ % %% ',
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ @@TEST@@ \\\" \\ , ; : . 日本語­% %%',
'&amp; \' \\" \ \'$@NULL@$ < > & &lt; &gt; @@TEST@@ \\\" \\ , ; : . 日本語­% %%',
'< > & &lt; &gt; &amp; \' \\" \ \\\" \\ , ; : . \'$@NULL@$ @@TEST@@ 日本語­% %%',
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ 日本語­% %%@@TEST@@ \. \\" \\ , ; :',
'< > & &lt; &gt; \\\" \\ , ; : . 日本語&amp; \' \\" \ \'$@NULL@$ @@TEST@@­% %%',
'\' \\" \ \'$@NULL@$ @@TEST@@ < > & &lt; &gt; &amp; \\\" \\ , ; : . 日本語­% %%',
'\\\" \\ , ; : . 日本語­% < > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ @@TEST@@ %%',
'< > & &lt; &gt; &amp; \' \\" \ \'$@NULL@$ 日本語­% %% @@TEST@@ \\\" \\ . , ; :',
'. 日本語&amp; \' \\"< > & &lt; &gt; \\\" \\ , ; : \ \'$@NULL@$ @@TEST@@­% %%',
'&amp; \' \\" \ < > & &lt; &gt; \\\" \\ , ; : . 日本語\'$@NULL@$ @@TEST@@­% %%',
);
/**