public function CkEditorContext::assertEditorContains in Lightning Core 8.4
Same name and namespace in other branches
- 8.5 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorContains()
- 8 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorContains()
- 8.2 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorContains()
- 8.3 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorContains()
Asserts that a CKEditor's content contains a snippet of text.
@Then CKEditor should contain :text @Then CKEditor :id should contain :text
Parameters
string $text: The text (or HTML) snippet to look for.
string $id: (optional) The editor instance ID.
Throws
\Behat\Mink\Exception\ExpectationException If the editor does not contain the specified text.
File
- tests/
contexts/ CkEditorContext.behat.inc, line 72
Class
- CkEditorContext
- Contains step definitions for working with CKEditor instances.
Namespace
Acquia\LightningExtension\ContextCode
public function assertEditorContains($text, $id = NULL) {
$position = strpos($this
->getContent($id), $text);
if ($position == FALSE) {
throw new ExpectationException('Expected CKEditor ' . $id . ' to contain "' . $text . '".', $this
->getSession()
->getDriver());
}
}