mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
update $source->getContent()
This commit is contained in:
@@ -70,7 +70,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
|
|||||||
|
|
||||||
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
||||||
$this->assertTrue($tpl->source->exists);
|
$this->assertTrue($tpl->source->exists);
|
||||||
$this->assertEquals('case1', $tpl->source->content);
|
$this->assertEquals('case1', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -90,7 +90,7 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
|
|||||||
|
|
||||||
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
||||||
$this->assertTrue($tpl->source->exists);
|
$this->assertTrue($tpl->source->exists);
|
||||||
$this->assertEquals('case2', $tpl->source->content);
|
$this->assertEquals('case2', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -109,11 +109,11 @@ class CustomResourceAmbiguousTest extends PHPUnit_Smarty
|
|||||||
$resource_handler->setSegment('case1');
|
$resource_handler->setSegment('case1');
|
||||||
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
||||||
$this->assertTrue($tpl->source->exists);
|
$this->assertTrue($tpl->source->exists);
|
||||||
$this->assertEquals('case1', $tpl->source->content);
|
$this->assertEquals('case1', $tpl->source->getContent());
|
||||||
|
|
||||||
$resource_handler->setSegment('case2');
|
$resource_handler->setSegment('case2');
|
||||||
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
$tpl = $this->smarty->createTemplate('foobar.tpl');
|
||||||
$this->assertTrue($tpl->source->exists);
|
$this->assertTrue($tpl->source->exists);
|
||||||
$this->assertEquals('case2', $tpl->source->content);
|
$this->assertEquals('case2', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -61,7 +61,7 @@ class EvalResourceTest extends PHPUnit_Smarty
|
|||||||
public function testGetTemplateSource()
|
public function testGetTemplateSource()
|
||||||
{
|
{
|
||||||
$tpl = $this->smarty->createTemplate('eval:hello world{$foo}');
|
$tpl = $this->smarty->createTemplate('eval:hello world{$foo}');
|
||||||
$this->assertEquals('hello world{$foo}', $tpl->source->content);
|
$this->assertEquals('hello world{$foo}', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -84,7 +84,7 @@ class FileResourceTest extends PHPUnit_Smarty
|
|||||||
public function testGetTemplateSource()
|
public function testGetTemplateSource()
|
||||||
{
|
{
|
||||||
$tpl = $this->smarty->createTemplate('helloworld.tpl');
|
$tpl = $this->smarty->createTemplate('helloworld.tpl');
|
||||||
$this->assertEquals('hello world', $tpl->source->content);
|
$this->assertEquals('hello world', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testUsesCompiler()
|
public function testUsesCompiler()
|
||||||
|
@@ -55,7 +55,7 @@ class PhpResourceTest extends PHPUnit_Smarty
|
|||||||
* public function testGetTemplateSource()
|
* public function testGetTemplateSource()
|
||||||
* {
|
* {
|
||||||
* $tpl = $this->smarty->createTemplate('php:phphelloworld.php');
|
* $tpl = $this->smarty->createTemplate('php:phphelloworld.php');
|
||||||
* $this->assertContains('php hello world', $tpl->source->content);
|
* $this->assertContains('php hello world', $tpl->source->getContent());
|
||||||
* }
|
* }
|
||||||
* /**
|
* /**
|
||||||
* test usesCompiler
|
* test usesCompiler
|
||||||
|
@@ -60,7 +60,7 @@ class StreamResourceTest extends PHPUnit_Smarty
|
|||||||
public function testGetTemplateSource()
|
public function testGetTemplateSource()
|
||||||
{
|
{
|
||||||
$tpl = $this->smarty->createTemplate('global:mytest', null, null, $this->smarty);
|
$tpl = $this->smarty->createTemplate('global:mytest', null, null, $this->smarty);
|
||||||
$this->assertEquals('hello world {$foo}', $tpl->source->content);
|
$this->assertEquals('hello world {$foo}', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -72,7 +72,7 @@ class StringResourceTest extends PHPUnit_Smarty
|
|||||||
public function testGetTemplateSource()
|
public function testGetTemplateSource()
|
||||||
{
|
{
|
||||||
$tpl = $this->smarty->createTemplate('string:hello world{$foo}');
|
$tpl = $this->smarty->createTemplate('string:hello world{$foo}');
|
||||||
$this->assertEquals('hello world{$foo}', $tpl->source->content);
|
$this->assertEquals('hello world{$foo}', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -43,7 +43,7 @@ class CompilePhpTest extends PHPUnit_Smarty
|
|||||||
$this->smartyBC->compile_id = $testName;
|
$this->smartyBC->compile_id = $testName;
|
||||||
$tpl = $this->smartyBC->createTemplate($templateFile);
|
$tpl = $this->smartyBC->createTemplate($templateFile);
|
||||||
if ($phpHandling == Smarty::PHP_PASSTHRU || $phpHandling == Smarty::PHP_QUOTE) {
|
if ($phpHandling == Smarty::PHP_PASSTHRU || $phpHandling == Smarty::PHP_QUOTE) {
|
||||||
$result = str_replace("\r", '', $tpl->source->content);
|
$result = str_replace("\r", '', $tpl->source->getContent());
|
||||||
}
|
}
|
||||||
if ($phpHandling == Smarty::PHP_QUOTE) {
|
if ($phpHandling == Smarty::PHP_QUOTE) {
|
||||||
$result = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this, 'quote'), $result);
|
$result = preg_replace_callback('#(<\?(?:php|=)?)|(<%)|(<script\s+language\s*=\s*["\']?\s*php\s*["\']?\s*>)|(\?>)|(%>)|(<\/script>)#i', array($this, 'quote'), $result);
|
||||||
|
Reference in New Issue
Block a user