Skip to content
This repository has been archived by the owner on Aug 13, 2020. It is now read-only.

Commit

Permalink
Test
Browse files Browse the repository at this point in the history
  • Loading branch information
josephspurrier committed May 3, 2014
1 parent db1f657 commit f975ad1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/SurfStack/Templating/Template_Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -769,10 +769,11 @@ protected function parsePlugins($content)
{
$this->post = false;

$this->plugrex = array_values($this->loadPlugins());
//$this->plugrex = array_values($this->loadPlugins());
$this->plugrex = $this->loadPlugins();

// Load the plugin content and replace
return preg_replace_callback($this->plugrex, function($matches) {
return preg_replace_callback(array_values($this->plugrex), function($matches) {
$pluginName = $matches[1];
$pluginData = $matches[2];
// Block has content, Slice does not
Expand Down
8 changes: 4 additions & 4 deletions tests/SurfStack/Templating/Template_Engine_Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -376,10 +376,10 @@ public function testPlugRex()
$this->render();

$this->assertSame($this->view->plugrex, array(
0 => '/\{\s*(Blank)\s*(.*?)\}/i',
1 => '/\{\s*(Bold)\s*(.*?)\}(.[^\}\{]*?)\{\/\s*Bold\s*\}/i',
2 => '/\{\s*(Passthru)\s*(.*?)\}(.[^\}\{]*?)\{\/\s*Passthru\s*\}/i',
3 => '/\{\s*(Time)\s*(.*?)\}/i',
'Blank' => '/\{\s*(Blank)\s*(.*?)\}/i',
'Bold' => '/\{\s*(Bold)\s*(.*?)\}(.[^\}\{]*?)\{\/\s*Bold\s*\}/i',
'Passthru' => '/\{\s*(Passthru)\s*(.*?)\}(.[^\}\{]*?)\{\/\s*Passthru\s*\}/i',
'Time' => '/\{\s*(Time)\s*(.*?)\}/i',
));
}

Expand Down

0 comments on commit f975ad1

Please sign in to comment.