* @package taoQtiCommon * @subpackage test */ class PciJsonMarshallerTest extends TestCase { private $file; public function setUp(): void { parent::setUp(); $fileManager = new FileSystemFileManager(); $file = $fileManager->createFromData('Some text', 'text/plain'); $this->setFile($file); } public function tearDown(): void { parent::tearDown(); $fileManager = new FileSystemFileManager(); $file = $this->getFile(); $fileManager->delete($file); } protected function getFile() { return $this->file; } protected function setFile(QtiFile $file) { $this->file = $file; } public function testMarshallFile() { $file = $this->getFile(); $marshaller = new taoQtiCommon_helpers_PciJsonMarshaller(); $json = $marshaller->marshall($file); $this->assertEquals(array('base' => array('file' => array('mime' => taoQtiCommon_helpers_PciJsonMarshaller::FILE_PLACEHOLDER_MIMETYPE, 'data' => base64_encode(taoQtiCommon_helpers_PciJsonMarshaller::FILE_PLACEHOLDER_DATA)))), json_decode($json, true)); } }