/** * @When /^I parse$/ */ public function iParseBlock(PyStringNode $string) { $this->iParse($string->__toString()); }
/** * @Given I have HTML with the following: */ public function iRenderHtmlWithTheFollowing(PyStringNode $node) { $handle = fopen($this->tmpHtmlFile, 'w'); fwrite($handle, $node->__toString()); fclose($handle); }
/** * @Given class :fqcn has method :method with arguments :args and code */ public function classHasMethodWithArgumentsAndCode($fqcn, $method, $args, PyStringNode $code) { $this->checkRunkit(); $class = new \ReflectionClass($fqcn); if (!$class->hasMethod($method)) { throw new \RuntimeException(sprintf('Class %s does not have method %s', $fqcn, $method)); } runkit_method_redefine($fqcn, $method, $args, $code->__toString(), RUNKIT_ACC_PUBLIC); }