. /** * This file contains unit test related to xAPI library. * * @package core_xapi * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ namespace core_xapi\local\statement; use advanced_testcase; use core_xapi\xapi_exception; defined('MOODLE_INTERNAL') || die(); /** * Contains test cases for testing statement base class. * * @package core_xapi * @since Moodle 3.9 * @copyright 2020 Ferran Recio * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class item_testcase extends advanced_testcase { /** * Test item creation. */ public function test_create() { // This is a generic item so check that it can create and item and json encode later. $data = (object) [ 'this' => 'is', 'just' => 1, 'example' => ['of', 'structure'], ]; $item = item::create_from_data($data); $this->assertEquals(json_encode($item), json_encode($data)); } }