public function testSetFactoryClass() { $this->method->setClass($this->class); $this->assertSame($this->class, $this->method->getClass()); }
/** * Adds a method to the class. * * @param Method $method The method to add to the class. * * @return static The current instance. */ public function addMethod(Method $method) { if (isset($this->methods[$method->getName()])) { throw new RuntimeException(sprintf('The method "%s" exists already.', $method->getName())); } $this->methods[$method->getName()] = $method; $method->setClass($this); return $this; }