Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 12... Línea 12...
12
// GNU General Public License for more details.
12
// GNU General Public License for more details.
13
//
13
//
14
// You should have received a copy of the GNU General Public License
14
// You should have received a copy of the GNU General Public License
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
15
// along with Moodle.  If not, see <http://www.gnu.org/licenses/>.
Línea 16... Línea -...
16
 
-
 
17
/**
-
 
18
 * Provides {@link core_user_table_participants_search_test} class.
-
 
19
 *
-
 
20
 * @package   core_user
-
 
21
 * @category  test
-
 
22
 * @copyright 2020 Andrew Nicols <andrew@nicols.co.uk>
-
 
23
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
24
 */
-
 
25
 
16
 
Línea 26... Línea 17...
26
declare(strict_types=1);
17
declare(strict_types=1);
Línea 27... Línea 18...
27
 
18
 
Línea 39... Línea 30...
39
use stdClass;
30
use stdClass;
Línea 40... Línea 31...
40
 
31
 
41
/**
32
/**
42
 * Tests for the implementation of {@link core_user_table_participants_search} class.
33
 * Tests for the implementation of {@link core_user_table_participants_search} class.
-
 
34
 *
-
 
35
 * @package   core_user
43
 *
36
 * @category  test
44
 * @copyright 2020 Andrew Nicols <andrew@nicols.co.uk>
37
 * @copyright 2020 Andrew Nicols <andrew@nicols.co.uk>
45
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
38
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
46
 */
39
 */
Línea 47... Línea 40...
47
class participants_search_test extends advanced_testcase {
40
final class participants_search_test extends advanced_testcase {
48
 
41
 
49
    /**
42
    /**
50
     * Helper to convert a moodle_recordset to an array of records.
43
     * Helper to convert a moodle_recordset to an array of records.
Línea 188... Línea 181...
188
    /**
181
    /**
189
     * Data provider for role tests.
182
     * Data provider for role tests.
190
     *
183
     *
191
     * @return array
184
     * @return array
192
     */
185
     */
193
    public function role_provider(): array {
186
    public static function role_provider(): array {
194
        $tests = [
187
        $tests = [
195
            // Users who only have one role each.
188
            // Users who only have one role each.
196
            'Users in each role' => (object) [
189
            'Users in each role' => (object) [
197
                'users' => [
190
                'users' => [
198
                    'a' => [
191
                    'a' => [
Línea 691... Línea 684...
691
                        ],
684
                        ],
692
                    ],
685
                    ],
693
                    'NONE: Filter on student, teacher' => (object) [
686
                    'NONE: Filter on student, teacher' => (object) [
694
                        'roles' => ['student', 'teacher'],
687
                        'roles' => ['student', 'teacher'],
695
                        'jointype' => filter::JOINTYPE_NONE,
688
                        'jointype' => filter::JOINTYPE_NONE,
696
                        'count' => 5,
689
                        'count' => 4,
697
                        'expectedusers' => [
690
                        'expectedusers' => [
698
                            'c',
691
                            'c',
699
                            'd',
692
                            'd',
700
                            'e',
-
 
701
                            'g',
693
                            'g',
702
                            'h',
694
                            'h',
703
                        ],
695
                        ],
704
                    ],
696
                    ],
705
                    'NONE: Filter on student, teacher' => (object) [
697
                    'NONE: Filter on teacher, editingteacher' => (object) [
706
                        'roles' => ['teacher', 'editingteacher'],
698
                        'roles' => ['teacher', 'editingteacher'],
707
                        'jointype' => filter::JOINTYPE_NONE,
699
                        'jointype' => filter::JOINTYPE_NONE,
708
                        'count' => 3,
700
                        'count' => 3,
709
                        'expectedusers' => [
701
                        'expectedusers' => [
710
                            'a',
702
                            'a',