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
 * Tests for the dataformat plugins
-
 
19
 *
-
 
20
 * @package    core
-
 
21
 * @copyright  2020 Paul Holden <paulh@moodle.com>
-
 
22
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
23
 */
-
 
24
 
16
 
Línea -... Línea 17...
-
 
17
namespace core;
25
namespace core;
18
 
26
 
19
use coding_exception;
Línea 27... Línea 20...
27
use context_system;
20
use context_system;
28
use core_component;
21
use core_component;
29
 
22
 
30
/**
23
/**
31
 * Dataformat tests
24
 * Tests for the dataformat plugins
32
 *
25
 *
33
 * @package    core
26
 * @package    core
34
 * @covers     \core\dataformat
27
 * @covers     \core\dataformat
35
 * @copyright  2020 Paul Holden <paulh@moodle.com>
28
 * @copyright  2020 Paul Holden <paulh@moodle.com>
-
 
29
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
-
 
30
 */
-
 
31
final class dataformat_test extends \advanced_testcase {
-
 
32
 
-
 
33
    /**
-
 
34
     * Test getting writer instance for given dataformat
-
 
35
     */
-
 
36
    public function test_get_format_instance(): void {
-
 
37
        $instance = dataformat::get_format_instance('pdf');
-
 
38
        $this->assertInstanceOf(\dataformat_pdf\writer::class, $instance);
-
 
39
    }
-
 
40
 
-
 
41
    /**
-
 
42
     * Test getting writer instance for invalid dataformat
-
 
43
     */
-
 
44
    public function test_get_format_instance_invalid(): void {
-
 
45
        $this->expectException(coding_exception::class);
Línea 36... Línea 46...
36
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
46
        $this->expectExceptionMessage('Invalid dataformat (weird)');
37
 */
47
        dataformat::get_format_instance('weird');
38
class dataformat_test extends \advanced_testcase {
48
    }
39
 
49
 
40
    /**
50
    /**
41
     * Data provider to return array of dataformat types
51
     * Data provider to return array of dataformat types
42
     *
52
     *
Línea 43... Línea 53...
43
     * @return array
53
     * @return array
44
     */
54
     */
45
    public function write_data_provider(): array {
55
    public static function write_data_provider(): array {