/** * @param string $type * @param callable|null $callback * * @return Inheritance */ public function inheritance($type, callable $callback = null) { $inheritance = InheritanceFactory::create($type, $this->builder); if (is_callable($callback)) { $callback($inheritance); } return $inheritance; }
public function test_can_only_create_joined_or_single_table_inheritance() { $this->setExpectedException(InvalidArgumentException::class, 'Inheritance type [NON_EXISTING] does not exist. SINGLE_TABLE and JOINED are support'); InheritanceFactory::create('NON_EXISTING', $this->builder); }