Esempio n. 1
0
 /**
  * Update an instance of Xmi_Exporter with the current output settings
  * 
  * @param PHP_UML_Output_Xmi_Exporter $e Exporter object to update
  */
 private function setOutputXmiOptions(PHP_UML_Output_Xmi_Exporter $e)
 {
     $e->setLogicalView($this->logicalView);
     $e->setComponentView($this->componentView);
     $e->setDeploymentView($this->deploymentView);
     $e->setStereotypes($this->docblocks);
 }
Esempio n. 2
0
 /**
  * Rebuilds the set of original objects (stored in data-providers).
  * You should not need to run it. If you do so, run it with a
  * trusted version of UML.
  */
 public static function rebuildExpectedParsePhp()
 {
     foreach (new DirectoryIterator(self::SUITE_DIR) as $file) {
         if (!$file->isDot() && !$file->isDir()) {
             $filename = $file->getFilename();
             if (substr($filename, -4) == '.php') {
                 $uml = self::getPhpUmlObject();
                 $uml->parseFile(self::SUITE_DIR . $filename);
                 $str = serialize($uml->getModel());
                 $ptr = fopen(self::SUITE_DIR . self::PROVIDERS_DIR . $filename . '.obj', 'wb');
                 fwrite($ptr, $str);
                 fclose($ptr);
             }
         }
     }
     // Global check (the two XMI files)
     $uml = self::getPhpUmlObject();
     $uml->parseDirectory(self::SUITE_DIR);
     $e = new PHP_UML_Output_Xmi_Exporter();
     $e->setDeploymentView(true);
     $e->setComponentView(false);
     $e->setStereotypes(true);
     $e->setXmiVersion(1);
     $e->export(self::SUITE_DIR . self::PROVIDERS_DIR . 'global1.xmi');
     $e->setXmiVersion(2);
     $e->export(self::SUITE_DIR . self::PROVIDERS_DIR . 'global2.xmi');
     // used by UmlParserTest::providerModelGlobal():
     $str = serialize($uml->getModel());
     $ptr = fopen(self::SUITE_DIR . self::PROVIDERS_DIR . 'global.obj', 'wb');
     fwrite($ptr, $str);
     fclose($ptr);
 }