New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.3.0 #47

Merged
merged 74 commits into from Sep 25, 2016
Commits
Jump to file or symbol
Failed to load files and symbols.
+30 −22
Diff settings

Always

Just for now

Viewing a subset of changes. View all

Fix plugin names with namespaces

  • Loading branch information...
emulienfou committed Sep 18, 2016
commit c568e69f28a2077f8a5c622250747ca0beba9f17
Copy path View file
@@ -1,4 +1,6 @@
<?php
/**
*/
class BlockTests extends PHPUnit_Framework_TestCase
{
@@ -41,7 +43,7 @@ public function testA()
<a href="http://foo/">http://foo/</a>', $this->dwoo->get($tpl, array('url' => 'http://foo/'), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_a($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginA($this->dwoo);
$fixCall->init('');
}
@@ -83,7 +85,7 @@ public function testAutoEscape()
$this->assertEquals('a<b>ca&lt;b&gt;c', $this->dwoo->get($tpl, array('foo' => 'a<b>c')));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_auto_escape($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginAutoEscape($this->dwoo);
$fixCall->init('');
}
@@ -115,7 +117,7 @@ public function testCapture()
$this->assertEquals('BAZZ', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_capture($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginCapture($this->dwoo);
$fixCall->init('');
}
@@ -132,7 +134,7 @@ public function testDynamic()
$this->assertEquals('t'.$preTime.$postTime, $this->dwoo->get($tpl, array('pre' => $postTime), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_dynamic($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginDynamic($this->dwoo);
$fixCall->init('');
}
@@ -149,7 +151,7 @@ public function testDynamicNested()
$this->assertEquals('t'.$preTime.$postTime.$postTime, $this->dwoo->get($tpl, array('pre' => $postTime), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_dynamic($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginDynamic($this->dwoo);
$fixCall->init('');
}
@@ -189,7 +191,7 @@ public function testNonExtendedBlocksFromParent()
baz'));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_block($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginBlock($this->dwoo);
$fixCall->init('');
}
@@ -244,7 +246,7 @@ public function testIf()
$this->assertEquals('true', $this->dwoo->get($tpl, array('foo' => 'bar'), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_if($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginIf($this->dwoo);
$fixCall->init(array());
}
@@ -288,7 +290,7 @@ public function testIfElseif()
$this->assertEquals('false', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_elseif($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginElseif($this->dwoo);
$fixCall->init(array());
}
@@ -300,7 +302,7 @@ public function testIfElse()
$this->assertEquals('false', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_else($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginElse($this->dwoo);
$fixCall->init();
}
@@ -365,7 +367,7 @@ public function testFor()
$this->assertEquals('0.foo1.bar', $this->dwoo->get($tpl, array('sub' => array('foo', 'bar', 'baz', 'qux')), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_for($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginFor($this->dwoo);
$fixCall->init(null, null);
}
@@ -407,7 +409,7 @@ public function testForElse()
$this->assertEquals('0369', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_forelse($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginForelse($this->dwoo);
$fixCall->init(null, null);
}
@@ -419,7 +421,7 @@ public function testForeachSmarty()
$this->assertEquals('0.foo1.bar', $this->dwoo->get($tpl, array('sub' => array('foo', 'bar')), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_foreach($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginForeach($this->dwoo);
$fixCall->init('');
}
@@ -493,7 +495,7 @@ public function testForeachElseEmpty()
$this->assertEquals('bar', $this->dwoo->get($tpl, array('sub' => array()), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_foreachelse($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginForeachelse($this->dwoo);
$fixCall->init('');
}
@@ -513,7 +515,7 @@ public function testLoop()
$this->assertEquals('0>a/b1>c/d', $this->dwoo->get($tpl, array('foo' => array(array('a', 'b'), array('c', 'd'))), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_loop($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginLoop($this->dwoo);
$fixCall->init('');
}
@@ -525,7 +527,7 @@ public function testLoopElse()
$this->assertEquals('MOO', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_loop($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginLoop($this->dwoo);
$fixCall->init('');
}
@@ -543,7 +545,7 @@ public function testStrip()
$this->assertEquals("abca\nb\nc", $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_strip($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginStrip($this->dwoo);
$fixCall->init('');
}
@@ -575,7 +577,7 @@ public function testStripWithPhp()
// $this->dwoo->get($tpl, array('menu'=>array('foo', 'bar'=>array('baz','qux'), 'boo'=>array('far'=>array('faz','mux')), 'duck')), $this->compiler));
// // fixes the init call not being called (which is normal)
// $fixCall = new Dwoo_Plugin_template($this->dwoo);
// $fixCall = new Dwoo\Plugins\Blocks\PluginTemplate($this->dwoo);
// $fixCall->init('');
// }
@@ -589,7 +591,7 @@ public function testStripWithPhp()
// $this->compiler->setAutoEscape(false);
// // fixes the init call not being called (which is normal)
// $fixCall = new Dwoo_Plugin_template($this->dwoo);
// $fixCall = new Dwoo\Plugins\Blocks\PluginTemplate($this->dwoo);
// $fixCall->init('');
// }
@@ -651,9 +653,9 @@ public function testWith()
$this->assertEquals('barbarNOB--b', $this->dwoo->get($tpl, array('foo' => array('a' => array('bar'))), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_with($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginWith($this->dwoo);
$fixCall->init('');
$fixCall = new Dwoo_Plugin_withelse($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginWithelse($this->dwoo);
$fixCall->init('');
}
}
Copy path View file
@@ -1,4 +1,6 @@
<?php
/**
*/
class CompilerTests extends PHPUnit_Framework_TestCase
{
@@ -10,7 +12,9 @@ public function __construct()
{
// extend this class and override this in your constructor to test a modded compiler
$this->compiler = new Dwoo\Compiler();
$this->dwoo = new Dwoo\Core(DWOO_COMPILE_DIR, DWOO_CACHE_DIR);
$this->dwoo = new Dwoo\Core(
dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR.'compiled',
dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR.'cache');
}
public function testVarReplacement()
Copy path View file
@@ -1,4 +1,6 @@
<?php
/**
*/
class CoreTests extends PHPUnit_Framework_TestCase
{
@@ -21,7 +23,7 @@ public function testCoverConstructorsEtc()
$this->assertEquals('', $this->dwoo->get($tpl, array(), $this->compiler));
// fixes the init call not being called (which is normal)
$fixCall = new Dwoo_Plugin_topLevelBlock($this->dwoo);
$fixCall = new Dwoo\Plugins\Blocks\PluginTopLevelBlock($this->dwoo);
$fixCall->init('');
}
Copy path View file
No changes.
Copy path View file
No changes.
ProTip! Use n and p to navigate between commits in a pull request.