public function end() { if (null === $this->parent) { throw new RuntimeException('No parent builder to return to'); } return $this->parent; }
public function testEndThrowsExceptionIfNoParentBuilder() { $builder = new CliMenuBuilder(); $this->setExpectedException(RuntimeException::class, 'No parent builder to return to'); $builder->end(); }