/** * Tests if the used structures are picked up correctly * * @return void */ public function testUsedStructures() { $this->assertCount(2, $this->resultClass->getUsedStructures()); }
/** * Will create a file for a given interface definition. * We will just copy the file here until the autoloader got refactored. * * @param string $targetFileName The intended name of the new file * @param \AppserverIo\Doppelgaenger\Entities\Definitions\InterfaceDefinition $structureDefinition The definition of the structure we will alter * * @return boolean * * TODO remove when autoloader is able to recognize and skip interfaces */ protected function createFileFromInterfaceDefinition($targetFileName, InterfaceDefinition $structureDefinition) { // Get the content of the file $content = file_get_contents($structureDefinition->getPath()); // Make the one change we need, the original file path and modification timestamp $content = str_replace('<?php', '<?php /* ' . Placeholders::ORIGINAL_PATH_HINT . $structureDefinition->getPath() . '#' . filemtime($structureDefinition->getPath()) . Placeholders::ORIGINAL_PATH_HINT . ' */', $content); return (bool) file_put_contents($targetFileName, $content); }