mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
Mass refactory
Rename project
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
<?php
|
||||
namespace Aspect;
|
||||
use Aspect, Aspect\Modifier, Aspect\TestCase;
|
||||
namespace Cytro;
|
||||
use Cytro, Cytro\TestCase;
|
||||
use Symfony\Component\Process\Exception\LogicException;
|
||||
|
||||
class ExtendsTemplateTest extends TestCase {
|
||||
public static function providerExtends() {
|
||||
$a = array("one" => 1, "two" => 2, "three" => 3);
|
||||
|
||||
public static function providerExtends($items) {
|
||||
return array(
|
||||
array("parent.tpl", "Parent. B1: {block b1}{/block}\nB2: {block 'b2'}empty {\$iteration}{/block}", $a,
|
||||
"Parent. B1: \nB2: empty 0"),
|
||||
@@ -23,6 +24,10 @@ class ExtendsTemplateTest extends TestCase {
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function setUp() {
|
||||
$this->cytro = Cytro::factory(CYTRO_RESOURCES.'/template', CYTRO_RESOURCES.'/compile');
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider providerExtends
|
||||
* @param $name
|
||||
@@ -30,7 +35,7 @@ class ExtendsTemplateTest extends TestCase {
|
||||
* @param $vars
|
||||
* @param $result
|
||||
*/
|
||||
public function testStaticExtends($name, $code, $vars, $result) {
|
||||
public function _testStaticExtends($name, $code, $vars, $result) {
|
||||
static $i = 0;
|
||||
$vars["iteration"] = $i++;
|
||||
$this->execTpl($name, $code, $vars, $result);
|
||||
@@ -43,7 +48,7 @@ class ExtendsTemplateTest extends TestCase {
|
||||
* @param $vars
|
||||
* @param $result
|
||||
*/
|
||||
public function testDynamicExtends($name, $code, $vars, $result) {
|
||||
public function _testDynamicExtends($name, $code, $vars, $result) {
|
||||
static $i = 0;
|
||||
$vars["iteration"] = $i++;
|
||||
$this->execTpl($name, $code, $vars, $result, 0);
|
||||
@@ -54,7 +59,7 @@ class ExtendsTemplateTest extends TestCase {
|
||||
*/
|
||||
public function _testParentLevel() {
|
||||
//echo($this->aspect->getTemplate("parent.tpl")->_body); exit;
|
||||
$this->assertSame($this->aspect->fetch("parent.tpl", array("a" => "a char")), "Parent template\nBlock1: Block2: Block3: default");
|
||||
$this->assertSame($this->cytro->fetch("parent.tpl", array("a" => "a char")), "Parent template\nBlock1: Block2: Block3: default");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -68,7 +73,7 @@ class ExtendsTemplateTest extends TestCase {
|
||||
* @group extends
|
||||
*/
|
||||
public function _testChildLevel3() {
|
||||
echo($this->aspect->getTemplate("child3.tpl")->getBody()); exit;
|
||||
echo($this->cytro->getTemplate("child3.tpl")->getBody()); exit;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user