public function testSetupObject() { $inheritance = new Inheritance(); $inheritance->loadMapping(['key' => 'baz', 'extends' => 'BaseObject', 'class' => 'Foo\\Bar', 'package' => 'Foo']); $this->assertSame('Foo', $inheritance->getPackage()); $this->assertSame('BaseObject', $inheritance->getAncestor()); $this->assertSame('baz', $inheritance->getKey()); $this->assertSame('Foo\\Bar', $inheritance->getClassName()); }
/** * Adds a new inheritance definition to the inheritance list and sets the * parent column of the inheritance to the current column. * * @param Inheritance|array $inheritance * @return Inheritance */ public function addInheritance($inheritance) { if ($inheritance instanceof Inheritance) { $inheritance->setColumn($this); if (null === $this->inheritanceList) { $this->inheritanceList = []; $this->isEnumeratedClasses = true; } $this->inheritanceList[] = $inheritance; return $inheritance; } $inh = new Inheritance(); $inh->loadMapping($inheritance); return $this->addInheritance($inh); }