Skip to content

Commit

Permalink
Chore: fix tests, update pr template and update CI (#163)
Browse files Browse the repository at this point in the history
* fix: Move PR template to proper directory
* fix: fix unit test
* chore: update actions to latest versions
  • Loading branch information
Levdbas authored May 21, 2024
1 parent b8dd129 commit c116aea
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
File renamed without changes.
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

- uses: ramsey/composer-install@v2
- uses: ramsey/composer-install@v3

- name: Run tests
run: composer run test
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/composer.lock
/vendor/
/wordpress/
.phpunit.result.cache
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ function testTimberExists() {

function testFunctionsPHP() {
$context = Timber::context();
$this->assertEquals('StarterSite', get_class($context['site']));
$this->assertEquals('App\StarterSite', get_class($context['site']));
$this->assertTrue(current_theme_supports('post-thumbnails'));
$this->assertEquals('bar', $context['foo']);
}

function testLoading() {
$str = Timber::compile('tease.twig');
$str = Timber::compile('partials/tease.twig');
$this->assertStringStartsWith('<article class="tease tease-" id="tease-">', $str);
$this->assertStringEndsWith('</article>', $str);
}
Expand All @@ -46,7 +46,8 @@ function testLoading() {
* Helper test to output current twig version
*/
function testTwigVersion() {
// $version = Timber::compile_string("{{ version }}", [ 'version', Twig\Environment::VERSION ]);
$version = Timber::compile_string("{{ version }}", [ 'version' => Twig\Environment::VERSION ]);
$this->assertEquals(Twig\Environment::VERSION, $version);
}

function testTwigFilter() {
Expand Down

0 comments on commit c116aea

Please sign in to comment.