Skip to content

Commit

Permalink
Fix coverage badge (#61)
Browse files Browse the repository at this point in the history
* Fix coverage badge

* Add unit tests for getRuntime()
  • Loading branch information
kylekatarnls authored Dec 27, 2020
1 parent 6def7d3 commit b49adcb
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
run: vendor/bin/phpunit --verbose --coverage-text --coverage-clover=coverage.xml

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

- name: Coverage
if: matrix.coverage
run: bash <(curl -s https://codecov.io/bash)
env:
PHP_VERSION: ${{ matrix.php }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![Latest Stable Version](https://poser.pugx.org/pug-php/pug-symfony/v/stable.png)](https://packagist.org/packages/pug-php/pug-symfony)
[![GitHub Actions](https://github.com/pug-php/pug-symfony/workflows/Tests/badge.svg)](https://github.com/pug-php/pug-symfony/actions)
[![StyleCI](https://styleci.io/repos/61784988/shield?style=flat)](https://styleci.io/repos/61784988)
[![Test Coverage](https://codeclimate.com/github/pug-php/pug-symfony/badges/coverage.svg)](https://codecov.io/github/pug-php/pug-symfony?branch=master)
[![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)

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

Expand Down
35 changes: 35 additions & 0 deletions tests/Pug/EnvironmentTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace Pug\Tests;

use Pug\Twig\Environment;
use Twig\Error\RuntimeError;
use Twig\Loader\ArrayLoader;

class EnvironmentTest extends AbstractTestCase
{
/**
* @throws RuntimeError
*/
public function testWithoutRoot()
{
self::expectException(RuntimeError::class);
self::expectExceptionMessage('Unable to load the "I-surely-does-not-exist" runtime.');

$env = new Environment(new ArrayLoader());
$env->getRuntime('I-surely-does-not-exist');
}

/**
* @throws RuntimeError
*/
public function testWithRoot()
{
self::expectException(RuntimeError::class);
self::expectExceptionMessage('Unable to load the "I-surely-does-not-exist" runtime.');

$env = new Environment(new ArrayLoader());
$env->rootEnv = new Environment(new ArrayLoader());
$env->getRuntime('I-surely-does-not-exist');
}
}

0 comments on commit b49adcb

Please sign in to comment.