Proyectos de Subversion Moodle

Rev

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

Rev 11 Rev 1441
Línea 25... Línea 25...
25
 * @package    tool_moodlenet
25
 * @package    tool_moodlenet
26
 * @category   test
26
 * @category   test
27
 * @copyright  2020 Jake Dallimore <jrhdallimore@gmail.com>
27
 * @copyright  2020 Jake Dallimore <jrhdallimore@gmail.com>
28
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 */
29
 */
30
class remote_resource_test extends \advanced_testcase {
30
final class remote_resource_test extends \advanced_testcase {
Línea 31... Línea 31...
31
 
31
 
32
    /**
32
    /**
33
     * Test getters.
33
     * Test getters.
34
     *
34
     *
Línea 51... Línea 51...
51
    /**
51
    /**
52
     * Data provider generating remote urls.
52
     * Data provider generating remote urls.
53
     *
53
     *
54
     * @return array
54
     * @return array
55
     */
55
     */
56
    public function remote_resource_data_provider() {
56
    public static function remote_resource_data_provider(): array {
57
        return [
57
        return [
58
            'With filename and extension' => [
58
            'With filename and extension' => [
59
                $this->getExternalTestFileUrl('/test.html'),
59
                self::getExternalTestFileUrl('/test.html'),
60
                (object) [
60
                (object) [
61
                    'name' => 'Test html file',
61
                    'name' => 'Test html file',
62
                    'description' => 'Full description of the html file'
62
                    'description' => 'Full description of the html file'
63
                ],
63
                ],
64
                'html'
64
                'html'
Línea 76... Línea 76...
76
 
76
 
77
    /**
77
    /**
78
     * Test confirming the network based operations of a remote_resource.
78
     * Test confirming the network based operations of a remote_resource.
79
     */
79
     */
80
    public function test_network_features(): void {
80
    public function test_network_features(): void {
81
        $url = $this->getExternalTestFileUrl('/test.html');
81
        $url = self::getExternalTestFileUrl('/test.html');
Línea 82... Línea 82...
82
        $nonexistenturl = $this->getExternalTestFileUrl('/test.htmlzz');
82
        $nonexistenturl = self::getExternalTestFileUrl('/test.htmlzz');
83
 
83
 
84
        $remoteres = new remote_resource(
84
        $remoteres = new remote_resource(
85
            new \curl(),
85
            new \curl(),