Skip to content

Commit c116aea

Browse files
authored
Chore: fix tests, update pr template and update CI (#163)
* fix: Move PR template to proper directory * fix: fix unit test * chore: update actions to latest versions
1 parent b8dd129 commit c116aea

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed
File renamed without changes.

.github/workflows/test.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
steps:
5555
- name: Checkout
56-
uses: actions/checkout@v3
56+
uses: actions/checkout@v4
5757

5858
- name: Setup PHP
5959
uses: shivammathur/setup-php@v2
@@ -68,7 +68,7 @@ jobs:
6868
- name: Setup problem matchers for PHPUnit
6969
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
7070

71-
- uses: ramsey/composer-install@v2
71+
- uses: ramsey/composer-install@v3
7272

7373
- name: Run tests
7474
run: composer run test

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
/composer.lock
22
/vendor/
33
/wordpress/
4+
.phpunit.result.cache

tests/TestTimberStarterTheme.php tests/test-timber-starter-theme.php

+4-3
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ function testTimberExists() {
3131

3232
function testFunctionsPHP() {
3333
$context = Timber::context();
34-
$this->assertEquals('StarterSite', get_class($context['site']));
34+
$this->assertEquals('App\StarterSite', get_class($context['site']));
3535
$this->assertTrue(current_theme_supports('post-thumbnails'));
3636
$this->assertEquals('bar', $context['foo']);
3737
}
3838

3939
function testLoading() {
40-
$str = Timber::compile('tease.twig');
40+
$str = Timber::compile('partials/tease.twig');
4141
$this->assertStringStartsWith('<article class="tease tease-" id="tease-">', $str);
4242
$this->assertStringEndsWith('</article>', $str);
4343
}
@@ -46,7 +46,8 @@ function testLoading() {
4646
* Helper test to output current twig version
4747
*/
4848
function testTwigVersion() {
49-
// $version = Timber::compile_string("{{ version }}", [ 'version', Twig\Environment::VERSION ]);
49+
$version = Timber::compile_string("{{ version }}", [ 'version' => Twig\Environment::VERSION ]);
50+
$this->assertEquals(Twig\Environment::VERSION, $version);
5051
}
5152

5253
function testTwigFilter() {

0 commit comments

Comments
 (0)