public function testGetName() { $this->assertSame('doSomething', $this->method->getName()); }
/** * 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; }