Skip to content

Commit b49adcb

Browse files
authored
Fix coverage badge (#61)
* Fix coverage badge * Add unit tests for getRuntime()
1 parent 6def7d3 commit b49adcb

File tree

3 files changed

+36
-3
lines changed

3 files changed

+36
-3
lines changed

.github/workflows/coverage.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ jobs:
3535
run: vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.xml
3636

3737
- name: Code Climate Test Reporter
38-
if: matrix.coverage
3938
uses: aktions/codeclimate-test-reporter@v1
4039
with:
4140
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
@@ -45,7 +44,6 @@ jobs:
4544
continue-on-error: true
4645

4746
- name: Coverage
48-
if: matrix.coverage
4947
run: bash <(curl -s https://codecov.io/bash)
5048
env:
5149
PHP_VERSION: ${{ matrix.php }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[![Latest Stable Version](https://poser.pugx.org/pug-php/pug-symfony/v/stable.png)](https://packagist.org/packages/pug-php/pug-symfony)
33
[![GitHub Actions](https://github.com/pug-php/pug-symfony/workflows/Tests/badge.svg)](https://github.com/pug-php/pug-symfony/actions)
44
[![StyleCI](https://styleci.io/repos/61784988/shield?style=flat)](https://styleci.io/repos/61784988)
5-
[![Test Coverage](https://codeclimate.com/github/pug-php/pug-symfony/badges/coverage.svg)](https://codecov.io/github/pug-php/pug-symfony?branch=master)
5+
[![Test Coverage](https://codecov.io/gh/pug-php/pug-symfony/branch/master/graph/badge.svg?token=yzjEnZzRNm)](https://codecov.io/github/pug-php/pug-symfony?branch=master)
66

77
[Pug template](https://phug-lang.com/) engine for Symfony
88

tests/Pug/EnvironmentTest.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Pug\Tests;
4+
5+
use Pug\Twig\Environment;
6+
use Twig\Error\RuntimeError;
7+
use Twig\Loader\ArrayLoader;
8+
9+
class EnvironmentTest extends AbstractTestCase
10+
{
11+
/**
12+
* @throws RuntimeError
13+
*/
14+
public function testWithoutRoot()
15+
{
16+
self::expectException(RuntimeError::class);
17+
self::expectExceptionMessage('Unable to load the "I-surely-does-not-exist" runtime.');
18+
19+
$env = new Environment(new ArrayLoader());
20+
$env->getRuntime('I-surely-does-not-exist');
21+
}
22+
23+
/**
24+
* @throws RuntimeError
25+
*/
26+
public function testWithRoot()
27+
{
28+
self::expectException(RuntimeError::class);
29+
self::expectExceptionMessage('Unable to load the "I-surely-does-not-exist" runtime.');
30+
31+
$env = new Environment(new ArrayLoader());
32+
$env->rootEnv = new Environment(new ArrayLoader());
33+
$env->getRuntime('I-surely-does-not-exist');
34+
}
35+
}

0 commit comments

Comments
 (0)