Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 14... Línea 14...
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...
16
 
16
 
Línea 17... Línea -...
17
namespace core;
-
 
18
 
-
 
19
defined('MOODLE_INTERNAL') || die();
-
 
20
 
-
 
21
global $CFG;
-
 
22
require_once($CFG->libdir . '/outputrequirementslib.php');
-
 
23
 
17
namespace core;
24
 
18
 
25
/**
19
/**
26
 * Unit tests for lib/outputrequirementslibphp.
20
 * Unit tests for lib/outputrequirementslibphp.
27
 *
21
 *
28
 * @package   core
22
 * @package   core
29
 * @category  test
23
 * @category  test
30
 * @copyright 2012 Petr Škoda
24
 * @copyright 2012 Petr Škoda
31
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
25
 * @license   http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 */
26
 */
33
class outputrequirementslib_test extends \advanced_testcase {
27
final class outputrequirementslib_test extends \advanced_testcase {
Línea 34... Línea 28...
34
    public function test_string_for_js(): void {
28
    public function test_string_for_js(): void {
35
        $this->resetAfterTest();
29
        $this->resetAfterTest();
Línea 167... Línea 161...
167
     *
161
     *
168
     * @return array
162
     * @return array
169
     * @see \page_requirements_manager::js_fix_url()
163
     * @see \page_requirements_manager::js_fix_url()
170
     * @see \moodle_url
164
     * @see \moodle_url
171
     */
165
     */
172
    public function js_fix_url_moodle_url_provider() {
166
    public static function js_fix_url_moodle_url_provider(): array {
173
        global $CFG;
167
        global $CFG;
174
        $wwwroot = rtrim($CFG->wwwroot, '/');
168
        $wwwroot = rtrim($CFG->wwwroot, '/');
175
        $libdir = rtrim($CFG->libdir, '/');
169
        $libdir = rtrim($CFG->libdir, '/');
176
        $admin = "/{$CFG->admin}/"; // Deprecated, just for coverage purposes.
170
        $admin = "/{$CFG->admin}/"; // Deprecated, just for coverage purposes.
Línea 249... Línea 243...
249
     * Data provider for JavaScript proper Handler using a plain relative string.
243
     * Data provider for JavaScript proper Handler using a plain relative string.
250
     *
244
     *
251
     * @return array
245
     * @return array
252
     * @see \page_requirements_manager::js_fix_url()
246
     * @see \page_requirements_manager::js_fix_url()
253
     */
247
     */
254
    public function js_fix_url_plain_string_provider() {
248
    public static function js_fix_url_plain_string_provider(): array {
255
        global $CFG;
249
        global $CFG;
256
        $wwwroot = rtrim($CFG->wwwroot, '/');
250
        $wwwroot = rtrim($CFG->wwwroot, '/');
257
        $admin = "/{$CFG->admin}/"; // Deprecated, just for coverage purposes.
251
        $admin = "/{$CFG->admin}/"; // Deprecated, just for coverage purposes.
Línea 258... Línea 252...
258
 
252
 
Línea 324... Línea 318...
324
     * Data provider for throwing coding exceptions in <u>\page_requirements_manager::js_fix_url()</u>.
318
     * Data provider for throwing coding exceptions in <u>\page_requirements_manager::js_fix_url()</u>.
325
     *
319
     *
326
     * @return array
320
     * @return array
327
     * @see \page_requirements_manager::js_fix_url()
321
     * @see \page_requirements_manager::js_fix_url()
328
     */
322
     */
329
    public function js_fix_url_coding_exception_provider() {
323
    public static function js_fix_url_coding_exception_provider(): array {
330
        global $CFG;
324
        global $CFG;
331
        $wwwroot = rtrim($CFG->wwwroot, '/');
325
        $wwwroot = rtrim($CFG->wwwroot, '/');
Línea 332... Línea 326...
332
 
326
 
333
        return [
327
        return [