-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix coverage badge * Add unit tests for getRuntime()
- Loading branch information
1 parent
6def7d3
commit b49adcb
Showing
3 changed files
with
36 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'); | ||
} | ||
} |