Exemplo n.º 1
0
 private function generateSubdefPathname(\record_adapter $record, \databox_subdef $subdef, $oldVersion = null)
 {
     if ($oldVersion) {
         $pathdest = \p4string::addEndSlash(pathinfo($oldVersion, PATHINFO_DIRNAME));
     } else {
         $pathdest = \databox::dispatch($this->filesystem, $subdef->get_path());
     }
     return $pathdest . $record->get_record_id() . '_' . $subdef->get_name() . '.' . $this->getExtensionFromSpec($subdef->getSpecs());
 }
Exemplo n.º 2
0
 /**
  * @covers databox_subdef::__construct
  * @covers databox_subdef::getSpecs
  * @covers databox_subdef::getOptions
  * @covers databox_subdef::buildFlexPaperSubdef
  */
 public function testFlexPaper()
 {
     $xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
             <subdef class="thumbnail" name="gifou" downloadable="false">
                 <path>/home/datas/noweb/db_alch_phrasea/video/</path>
                 <mediatype>flexpaper</mediatype>
             </subdef>';
     $type = new \Alchemy\Phrasea\Media\Type\Flash();
     $object = new databox_subdef($type, simplexml_load_string($xml), $this->getMock('Symfony\\Component\\Translation\\TranslatorInterface'));
     $this->assertInstanceOf('\\MediaAlchemyst\\Specification\\Flash', $object->getSpecs());
     $options = $object->getOptions();
     $this->assertTrue(is_array($options));
     foreach ($options as $option) {
         $this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\\Subdef\\OptionType\\OptionType', $option);
     }
 }