コード例 #1
0
ファイル: Cest.php プロジェクト: foxman209/Codeception
 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);
 }
コード例 #2
0
ファイル: ParserTest.php プロジェクト: Eli-TW/Codeception
 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());
 }
コード例 #3
0
ファイル: Cest.php プロジェクト: janhenkgerritsen/Codeception
 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);
     }
 }
コード例 #4
0
ファイル: Cest.php プロジェクト: solutionDrive/Codeception
 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));
     }
 }