コード例 #1
0
 /**
  * Test create new instance
  */
 public function testConstruct()
 {
     $objectPrefix = 'PhpOffice\\PhpPowerpoint\\Writer\\PowerPoint2007\\';
     $parts = array('contenttypes' => 'ContentTypes', 'docprops' => 'DocProps', 'rels' => 'Rels', 'theme' => 'Theme', 'presentation' => 'Presentation', 'slide' => 'Slide', 'drawing' => 'Drawing', 'chart' => 'Chart');
     $phpPowerPoint = new PhpPowerpoint();
     $object = new PowerPoint2007($phpPowerPoint);
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\PhpPowerpoint', $object->getPhpPowerpoint());
     $this->assertEquals('./', $object->getDiskCachingDirectory());
     $this->assertInstanceOf("{$objectPrefix}LayoutPack\\PackDefault", $object->getLayoutPack());
     foreach ($parts as $partName => $objectName) {
         $this->assertInstanceOf($objectPrefix . $objectName, $object->getWriterPart($partName));
     }
     $this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\HashTable', $object->getDrawingHashTable());
 }