public function CkEditorContext::assertEditorMatch in Lightning Core 8.4
Same name and namespace in other branches
- 8.5 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorMatch()
- 8 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorMatch()
- 8.2 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorMatch()
- 8.3 tests/contexts/CkEditorContext.behat.inc \Acquia\LightningExtension\Context\CkEditorContext::assertEditorMatch()
Assert that a CKEditor's content matches a regular expression.
@Then CKEditor should match :expression @Then CKEditor :id should match :expression
Parameters
string $expr: The regular expression to match.
string $id: (optional) The editor instance ID.
Throws
\Behat\Mink\Exception\ExpectationException If the expression does not match.
File
- tests/
contexts/ CkEditorContext.behat.inc, line 97
Class
- CkEditorContext
- Contains step definitions for working with CKEditor instances.
Namespace
Acquia\LightningExtension\ContextCode
public function assertEditorMatch($expr, $id = NULL) {
$match = preg_match($expr, $this
->getContent($id));
if ($match == 0) {
throw new ExpectationException('Expected CKEditor ' . $id . ' to match "' . $expr . '".', $this
->getSession()
->getDriver());
}
}