3
3
use Timber \Timber ;
4
4
use WorDBless \BaseTestCase ;
5
5
6
- class TestTimberStarterTheme extends BaseTestCase {
6
+ class TestTimberStarterTheme extends BaseTestCase
7
+ {
7
8
8
- public function set_up () {
9
+ public function set_up ()
10
+ {
9
11
switch_theme (basename (dirname (__DIR__ )) . '/theme ' );
10
12
11
13
require dirname (__DIR__ ) . '/functions.php ' ;
12
14
13
- Timber::$ dirname = array_merge ((array ) Timber::$ dirname , [ '../views ' ]);
15
+ Timber::$ dirname = array_merge ((array ) Timber::$ dirname , ['../views ' ]);
14
16
Timber::$ dirname = array_unique (Timber::$ dirname );
15
17
16
18
// WorDBless includes wp-settings.php
@@ -19,24 +21,28 @@ public function set_up() {
19
21
parent ::set_up ();
20
22
}
21
23
22
- function tear_down () {
24
+ function tear_down ()
25
+ {
23
26
parent ::tear_down ();
24
27
switch_theme ('twentytwenty ' );
25
28
}
26
29
27
- function testTimberExists () {
30
+ function testTimberExists ()
31
+ {
28
32
$ context = Timber::context ();
29
33
$ this ->assertTrue (is_array ($ context ));
30
34
}
31
35
32
- function testFunctionsPHP () {
36
+ function testFunctionsPHP ()
37
+ {
33
38
$ context = Timber::context ();
34
39
$ this ->assertEquals ('App\StarterSite ' , get_class ($ context ['site ' ]));
35
40
$ this ->assertTrue (current_theme_supports ('post-thumbnails ' ));
36
41
$ this ->assertEquals ('bar ' , $ context ['foo ' ]);
37
42
}
38
43
39
- function testLoading () {
44
+ function testLoading ()
45
+ {
40
46
$ str = Timber::compile ('partials/tease.twig ' );
41
47
$ this ->assertStringStartsWith ('<article class="tease tease-" id="tease-"> ' , $ str );
42
48
$ this ->assertStringEndsWith ('</article> ' , $ str );
@@ -45,13 +51,14 @@ function testLoading() {
45
51
/**
46
52
* Helper test to output current twig version
47
53
*/
48
- function testTwigVersion () {
49
- $ version = Timber::compile_string ("{{ version }} " , [ 'version ' => Twig \Environment::VERSION ]);
54
+ function testTwigVersion ()
55
+ {
56
+ $ version = Timber::compile_string ("{{ version }} " , ['version ' => Twig \Environment::VERSION ]);
50
57
$ this ->assertEquals (Twig \Environment::VERSION , $ version );
51
58
}
52
59
53
- function testTwigFilter () {
54
- $ str = Timber::compile_string ('{{ "foo"|myfoo }} ' );
55
- $ this ->assertEquals ('foo bar! ' , $ str );
56
- }
60
+ // function testTwigFilter() {
61
+ // $str = Timber::compile_string('{{ "foo"|myfoo }}');
62
+ // $this->assertEquals('foo bar!', $str);
63
+ // }
57
64
}
0 commit comments