Skip to content

Commit

Permalink
Test passing validator options array to processor
Browse files Browse the repository at this point in the history
  • Loading branch information
jbhannah committed Apr 25, 2016
1 parent 1dcc84b commit aab6f04
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/TinymceProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private function configureRules()
// If configuration is provided for the validator, include it in
// the rule.
if (is_array($this->config[$validator])) {
array_push($v, $this->config[$validator]);
$rule = array_merge($rule, $this->config[$validator]);
}

array_push($this->rules, $rule);
Expand Down
9 changes: 7 additions & 2 deletions tests/unit/TinymceProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,22 @@ public function testRunsTexturizeValidator()
public function testConfiguration()
{
$tmp = new TinymceProcessor(['config' => [
'autop' => [
'convertBr' => false
],
'essence' => false,
'texturize' => true
]]);

$input = <<<EOF
Some of this should be processed...but some shouldn't.
Some of this should be processed...
but some shouldn't.
https://www.youtube.com/watch?v=9bZkp7q19f0
EOF;
$expected = <<<EOF
<p>Some of this should be processed&#8230;but some shouldn&#8217;t.</p>
<p>Some of this should be processed&#8230;
but some shouldn&#8217;t.</p>
<p>https://www.youtube.com/watch?v=9bZkp7q19f0</p>
EOF;

Expand Down

0 comments on commit aab6f04

Please sign in to comment.