Example #1
0
 /**
  * Set the content of the feature
  *
  * @param string
  */
 public function setContent($content)
 {
     // @tmp
     // @todo
     // don't use directly the DIC
     $filename = 'tmp-' . uniqid() . '.feature';
     $path = $this->folder . $filename;
     file_put_contents($path, $content);
     $feature = $this->featureRepository->getFeatureByPath($filename);
     unlink($path);
     if ($feature === null) {
         throw new \Exception('Cannot set the content of the feature');
     }
     $this->gherkinObject = $feature->getGherkin();
 }