public function preload() { $this->scenario->setFeature($this->getSpecFromMethod()); $code = $this->getSourceCode(); $this->parser->parseFeature($code); $this->parser->attachMetadata(Annotation::forMethod($this->testClassInstance, $this->testMethod)->raw()); $this->getMetadata()->getService('di')->injectDependencies($this->testClassInstance); }
public function testFeatureCommented() { $code = "<?php\n //\\\$I->wantTo('run this test'); "; $this->parser->parseFeature($code); $this->assertNull($this->scenario->getFeature()); $code = "<?php\n /*\n \\\$I->wantTo('run this test'); \n */"; $this->parser->parseFeature($code); $this->assertNull($this->scenario->getFeature()); }
public function preload() { $this->scenario->setFeature($this->getSpecFromMethod()); $code = $this->getSourceCode(); $this->parser->parseFeature($code); $this->parser->attachMetadata(Annotation::forMethod($this->testClassInstance, $this->testMethod)->raw()); $this->getMetadata()->getService('di')->injectDependencies($this->testClassInstance); // add example params to feature if ($this->getMetadata()->getCurrent('example')) { $params = implode(', ', array_values($this->getMetadata()->getCurrent('example'))); $this->getScenario()->setFeature($this->getScenario()->getFeature() . ' | ' . $params); } }
public function preload() { $this->scenario->setFeature($this->getSpecFromMethod()); $code = $this->getSourceCode(); $this->parser->parseFeature($code); $this->parser->attachMetadata(Annotation::forMethod($this->testClassInstance, $this->testMethod)->raw()); $this->getMetadata()->getService('di')->injectDependencies($this->testClassInstance); // add example params to feature if ($this->getMetadata()->getCurrent('example')) { $step = new Comment('', $this->getMetadata()->getCurrent('example')); $this->getScenario()->setFeature($this->getScenario()->getFeature() . ' | ' . $step->getArgumentsAsString(100)); } }