public function testFromInvalidObject() { $this->setExpectedException('\\InvalidArgumentException'); $component = new stdClass(); $factory = new Qti21MarshallerFactory(); $marshaller = $factory->createMarshaller($component); }
public static function marshallValidQti(QtiComponent $component) { $marshallerFactory = new Qti21MarshallerFactory(); $marshaller = $marshallerFactory->createMarshaller($component); $element = $marshaller->marshall($component); $dom = new \DOMDocument(); $dom->preserveWhiteSpace = false; $dom->formatOutput = false; $node = $dom->importNode($element, true); return $dom->saveXML($node); }
public function __construct() { parent::__construct(); $this->addMappingEntry('object', 'LearnosityQti\\Processors\\QtiV2\\Marshallers\\LearnosityObjectMarshaller'); }