File tree Expand file tree Collapse file tree 3 files changed +39
-0
lines changed
Expand file tree Collapse file tree 3 files changed +39
-0
lines changed Original file line number Diff line number Diff line change 6767
6868load_class ('Loader ' , 'core ' );
6969load_class ('Router ' , 'core ' );
70+ load_class ('Output ' , 'core ' );
7071load_class ('Input ' , 'core ' );
7172load_class ('Lang ' , 'core ' );
7273
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ class TwigTest extends PHPUnit_Framework_TestCase
4+ {
5+ public static function setUpBeforeClass ()
6+ {
7+ parent ::setUpBeforeClass ();
8+ $ CI =& get_instance ();
9+ $ CI ->load ->library ('Twig ' );
10+ $ CI ->load ->helper ('url_helper ' );
11+ $ CI ->load ->helper ('form_helper ' );
12+ }
13+
14+ public function testRedner ()
15+ {
16+ $ obj = new Twig (['paths ' => __DIR__ . '/../templates/ ' ]);
17+
18+ $ data = [
19+ 'name ' => 'CodeIgniter ' ,
20+ ];
21+ $ output = $ obj ->render ('welcome ' , $ data );
22+ $ this ->assertEquals ('Hello CodeIgniter! ' ."\n" , $ output );
23+ }
24+
25+ public function testDisplay ()
26+ {
27+ $ obj = new Twig (['paths ' => __DIR__ . '/../templates/ ' ]);
28+
29+ $ data = [
30+ 'name ' => 'CodeIgniter ' ,
31+ ];
32+ $ obj ->display ('welcome ' , $ data );
33+ $ CI =& get_instance ();
34+ $ output = $ CI ->output ->get_output ();
35+ $ this ->assertEquals ('Hello CodeIgniter! ' ."\n" , $ output );
36+ }
37+ }
Original file line number Diff line number Diff line change 1+ Hello {{ name }}!
You can’t perform that action at this time.
0 commit comments