public function testTargetConstructor() { $targetData = ['name' => 'name', 'namespace' => 'Namespace', 'withAnnotations' => 'Y', 'useClassNotations' => 1, 'withInitFunction' => true]; $target = new Target($targetData); $this->assertEquals('name', $target->getName(), 'name'); $this->assertEquals('Namespace', $target->getNamespace(), 'namespace'); $this->assertEquals(true, $target->isWithAnnotations(), 'withAnnotations'); $this->assertEquals(true, $target->isUseClassNotations(), 'useClassNotations'); $this->assertEquals(true, $target->isWithInitFunction(), 'withInitFunction'); }
public function __construct(Logger $logger, $sourceNamespace, array $targets = []) { $this->logger = $logger; $this->namespace = $sourceNamespace; $this->targets = []; foreach ($targets as $target) { if (!$target instanceof Target) { $target = new Target($target); } $this->targets[$target->getName()] = $target; } }