Skip to content

Commit b22b34d

Browse files
committed
Update TwigHelperTest
1 parent 4dcef2f commit b22b34d

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

tests/libraries/TwigHelperTest.php

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
<?php
22

3+
require __DIR__.'/../../libraries/Twig.php';
4+
35
class TwigHelperTest extends PHPUnit_Framework_TestCase
46
{
57
public static function setUpBeforeClass()
68
{
79
parent::setUpBeforeClass();
810
$CI =& get_instance();
9-
$CI->load->library('twig');
10-
$CI->load->helper('url_helper');
11+
$CI->load->helper('url');
1112
}
1213

1314
public function setUp()
1415
{
15-
$CI =& get_instance();
16+
$twig = new Twig();
1617

1718
$loader = new Twig_Loader_Array([
1819
'base_url' => '{{ base_url(\'"><s>abc</s><a name="test\') }}',
1920
'site_url' => '{{ site_url(\'"><s>abc</s><a name="test\') }}',
2021
'anchor' => '{{ anchor(uri, title, attributes) }}',
2122
]);
2223
$setLoader = ReflectionHelper::getPrivateMethodInvoker(
23-
$CI->twig, 'setLoader'
24+
$twig, 'setLoader'
2425
);
2526
$setLoader($loader);
2627

2728
$resetTwig = ReflectionHelper::getPrivateMethodInvoker(
28-
$CI->twig, 'resetTwig'
29+
$twig, 'resetTwig'
2930
);
3031
$resetTwig();
3132

3233
$addFunctions = ReflectionHelper::getPrivateMethodInvoker(
33-
$CI->twig, 'addFunctions'
34+
$twig, 'addFunctions'
3435
);
3536
$addFunctions();
3637

37-
$this->obj = $CI->twig;
38-
$this->twig = $CI->twig->getTwig();
38+
$this->obj = $twig;
39+
$this->twig = $twig->getTwig();
3940
}
4041

4142
public function test_anchor()

0 commit comments

Comments
 (0)