|
@@ 66-75 (lines=10) @@
|
| 63 |
|
* @Then CKEditor should contain :text |
| 64 |
|
* @Then CKEditor :id should contain :text |
| 65 |
|
*/ |
| 66 |
|
public function assertEditorContains($text, $id = NULL) { |
| 67 |
|
$position = strpos($this->getContent($id), $text); |
| 68 |
|
|
| 69 |
|
if ($position == FALSE) { |
| 70 |
|
throw new ExpectationException( |
| 71 |
|
'Expected CKEditor ' . $id . ' to contain "' . $text . '".', |
| 72 |
|
$this->getSession()->getDriver() |
| 73 |
|
); |
| 74 |
|
} |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
/** |
| 78 |
|
* Assert that a CKEditor's content matches a regular expression. |
|
@@ 91-100 (lines=10) @@
|
| 88 |
|
* @Then CKEditor should match :expression |
| 89 |
|
* @Then CKEditor :id should match :expression |
| 90 |
|
*/ |
| 91 |
|
public function assertEditorMatch($expr, $id = NULL) { |
| 92 |
|
$match = preg_match($expr, $this->getContent($id)); |
| 93 |
|
|
| 94 |
|
if ($match == 0) { |
| 95 |
|
throw new ExpectationException( |
| 96 |
|
'Expected CKEditor ' . $id . ' to match "' . $expr . '".', |
| 97 |
|
$this->getSession()->getDriver() |
| 98 |
|
); |
| 99 |
|
} |
| 100 |
|
} |
| 101 |
|
|
| 102 |
|
/** |
| 103 |
|
* Gets the content of a CKEditor instance. |