mirror of
https://github.com/moodle/moodle.git
synced 2025-01-19 14:27:22 +01:00
Merge branch 'MDL-61364-master' of git://github.com/lameze/moodle
This commit is contained in:
commit
e8b3c3e178
@ -1630,8 +1630,8 @@ function question_has_capability_on($questionorid, $cap, $notused = -1) {
|
||||
|
||||
$context = context::instance_by_id($question->contextid);
|
||||
|
||||
// these are capabilities on existing questions capabilties are
|
||||
//set per category. Each of these has a mine and all version. Append 'mine' and 'all'
|
||||
// These are existing questions capabilities that are set per category.
|
||||
// Each of these has a 'mine' and 'all' version that is appended to the capability name.
|
||||
$capabilitieswithallandmine = ['edit' => 1, 'view' => 1, 'use' => 1, 'move' => 1, 'tag' => 1];
|
||||
|
||||
if (!isset($capabilitieswithallandmine[$cap])) {
|
||||
|
@ -1621,15 +1621,15 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when passing a stdClass.
|
||||
* Tests for the deprecated question_has_capability_on function when passing a stdClass as parameter.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $expectall The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_stdClass($capabilities, $capability, $isowner, $expect) {
|
||||
public function test_question_has_capability_on_using_stdclass($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
|
||||
// Create the test data.
|
||||
@ -1666,13 +1666,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question.
|
||||
* Tests for the deprecated question_has_capability_on function when using question definition.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $expectall The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_question_definition($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
@ -1718,13 +1718,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question.
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question id.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $expectall The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_question_id($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
@ -1770,13 +1770,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question.
|
||||
* Tests for the deprecated question_has_capability_on function when using a string as question id.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $expectall The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_question_string_id($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
@ -1822,13 +1822,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question.
|
||||
* Tests for the question_has_capability_on function when using a moved question.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $expectall The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_moved_question($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
@ -1885,13 +1885,13 @@ class core_questionlib_testcase extends advanced_testcase {
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests for the deprecated question_has_capability_on function when using a real question.
|
||||
* Tests for the question_has_capability_on function when using a real question.
|
||||
*
|
||||
* @dataProvider question_capability_on_question_provider
|
||||
* @param array $capabilities The capability assignments to set.
|
||||
* @param string $capability The capability to test
|
||||
* @param bool $isowner The expectation when passing false to checkmine.
|
||||
* @param bool $expectmine The expectation when passing true to checkmine.
|
||||
* @param bool $isowner Whether the user to create the question should be the owner or not.
|
||||
* @param bool $expect The expected result.
|
||||
*/
|
||||
public function test_question_has_capability_on_using_question($capabilities, $capability, $isowner, $expect) {
|
||||
$this->resetAfterTest();
|
||||
|
Loading…
x
Reference in New Issue
Block a user