mirror of
https://github.com/fenom-template/fenom.git
synced 2023-08-10 21:13:07 +03:00
migrate to php8
This commit is contained in:
@@ -241,7 +241,7 @@ class TestCase extends \PHPUnit\Framework\TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function providerVariables()
|
||||
public static function providerVariables()
|
||||
{
|
||||
return array(
|
||||
array('$one', 1),
|
||||
@@ -334,6 +334,13 @@ class Helper
|
||||
public function getArray() {
|
||||
return array(1,2,3);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws \Exception
|
||||
*/
|
||||
public static function throws() {
|
||||
throw new \Exception("helper exception");
|
||||
}
|
||||
}
|
||||
|
||||
function helper_func($string, $pad = 10) {
|
||||
|
||||
@@ -44,14 +44,9 @@ class RenderTest extends TestCase
|
||||
$this->assertSame("It is render's function fetch", self::$render->fetch(array("render" => "fetch")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @expectedException \RuntimeException
|
||||
* @expectedExceptionMessage template error
|
||||
*/
|
||||
public function testFetchException()
|
||||
{
|
||||
$this->expectException(\RuntimeException::class);
|
||||
$this->expectExceptionMessage("template error");
|
||||
$this->expectException(Fenom\Error\TemplateException::class);
|
||||
$render = new Render(Fenom::factory("."), function () {
|
||||
echo "error";
|
||||
throw new \RuntimeException("template error");
|
||||
|
||||
@@ -24,7 +24,7 @@ class FenomTest extends \Fenom\TestCase
|
||||
$time = $this->tpl('temp.tpl', 'Template 1 a');
|
||||
$fenom = new Fenom($provider = new \Fenom\Provider(FENOM_RESOURCES . '/template'));
|
||||
$fenom->setCompileDir(FENOM_RESOURCES . '/compile');
|
||||
$this->assertInstanceOf('Fenom\Template', $tpl = $fenom->getTemplate('temp.tpl'));
|
||||
$this->assertInstanceOf('Fenom\Render', $tpl = $fenom->getTemplate('temp.tpl'));
|
||||
$this->assertSame($provider, $tpl->getProvider());
|
||||
$this->assertSame('temp.tpl', $tpl->getBaseName());
|
||||
$this->assertSame('temp.tpl', $tpl->getName());
|
||||
@@ -40,7 +40,7 @@ class FenomTest extends \Fenom\TestCase
|
||||
FENOM_RESOURCES . '/compile',
|
||||
Fenom::AUTO_ESCAPE
|
||||
);
|
||||
$this->assertInstanceOf('Fenom\Template', $tpl = $fenom->getTemplate('temp.tpl'));
|
||||
$this->assertInstanceOf('Fenom\Render', $tpl = $fenom->getTemplate('temp.tpl'));
|
||||
$this->assertSame($provider, $tpl->getProvider());
|
||||
$this->assertSame('temp.tpl', $tpl->getBaseName());
|
||||
$this->assertSame('temp.tpl', $tpl->getName());
|
||||
|
||||
Reference in New Issue
Block a user