/** * @depends testUnitScannerMapping */ public function testMetadataCollectorProjectCreating(array $map) { $collector = new MetadataCollector(self::$directory . '/src', self::$directory . '/build'); $collector->setOutput(new NullOutput()); // no mock, runs phpdox intentionally $project = $collector->collect($map, ['public', 'protected', 'private']); $units = $project->getUnits(); self::assertTrue($units->has('Existent')); self::assertFalse($units->has('Inexistent')); }
/** * @param string $sourceDirectory * @param string[] $units * @return Project */ private function colectMetadata($sourceDirectory, array $units) { $this->output->writeln("Collecting metadata from {$sourceDirectory}"); $buildDirectory = sys_get_temp_dir() . '/phpact/metadata/' . time(); $collector = new MetadataCollector($sourceDirectory, $buildDirectory); $collector->setOutput($this->output); return $collector->collect($units, $this->input->getOption('visibility')); }