public function testBackground()
 {
     $feature = new FeatureNode();
     $this->assertNull($feature->getBackground());
     $this->assertFalse($feature->hasBackground());
     $feature->setBackground($background = new BackgroundNode());
     $this->assertSame($feature, $feature->getBackground()->getFeature());
     $this->assertSame($background, $feature->getBackground());
     $this->assertTrue($feature->hasBackground());
 }
 /**
  * {@inheritdoc}
  */
 public function test(Environment $env, FeatureNode $feature, Scenario $scenario, $skip = false)
 {
     $results = array();
     if ($feature->hasBackground()) {
         $backgroundResult = $this->testBackground($env, $feature, $skip);
         $skip = !$backgroundResult->isPassed() || $skip;
         $results[] = $backgroundResult;
     }
     $results = array_merge($results, $this->containerTester->test($env, $feature, $scenario, $skip));
     return new TestResults($results);
 }
Esempio n. 3
0
 public function hasBackground()
 {
     return $this->featureNode->hasBackground();
 }