/** * @test */ public function testAddPerson() { self::assertEquals($this->extension->getPersons(), array(), 'Extensions Persons are not empty.'); $this->extension->addPerson($this->persons[0]); $this->extension->addPerson($this->persons[1]); $this->extension->addPerson($this->persons[2]); self::assertEquals(count($this->extension->getPersons()), 3, 'To many Persons in Extension.'); $persons = $this->extension->getPersons(); self::assertEquals($persons[0]->getName(), '0', 'Wrong ordering of Persons in Extension.'); self::assertEquals($persons[1]->getName(), '1', 'Wrong ordering of Persons in Extension.'); self::assertEquals($persons[2]->getName(), '2', 'Wrong ordering of Persons in Extension.'); }
/** * generate a docComment for class files. Add a license haeder if none found * @param \EBT\ExtensionBuilder\Domain\Model\ClassObject\ClassObject $classObject * * @return void; */ protected function addLicenseHeader($classObject) { $comments = $classObject->getComments(); $needsLicenseHeader = true; foreach ($comments as $comment) { if (strpos($comment, 'GNU General Public License') !== false) { $needsLicenseHeader = false; } } if ($needsLicenseHeader) { $licenseHeader = $this->renderTemplate('Partials/Classes/licenseHeader.phpt', array('persons' => $this->extension->getPersons())); $classObject->addComment($licenseHeader); } }