Merge pull request #45 from khepin/element_should_not_contain

Add "element should contain" counter part "should NOT contain"
This commit is contained in:
Konstantin Kudryashov
2012-10-15 05:15:18 -07:00
2 changed files with 20 additions and 0 deletions

View File

@@ -317,6 +317,16 @@ class MinkContext extends RawMinkContext implements TranslatedContextInterface
$this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value)); $this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value));
} }
/**
* Checks, that element with specified CSS doesn't contain specified HTML.
*
* @Then /^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertElementNotContains($element, $value)
{
$this->assertSession()->elementNotContains('css', $element, $this->fixStepArgument($value));
}
/** /**
* Checks, that element with specified CSS exists on page. * Checks, that element with specified CSS exists on page.
* *

View File

@@ -383,6 +383,16 @@ trait MinkDictionary
$this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value)); $this->assertSession()->elementContains('css', $element, $this->fixStepArgument($value));
} }
/**
* Checks, that element with specified CSS doesn't contain specified HTML.
*
* @Then /^the "(?P<element>[^"]*)" element should not contain "(?P<value>(?:[^"]|\\")*)"$/
*/
public function assertElementNotContains($element, $value)
{
$this->assertSession()->elementNotContains('css', $element, $this->fixStepArgument($value));
}
/** /**
* Checks, that element with specified CSS exists on page. * Checks, that element with specified CSS exists on page.
* *