Skip to content

Commit

Permalink
Rename class to Engine
Browse files Browse the repository at this point in the history
  • Loading branch information
tylersriver committed Oct 4, 2022
1 parent 7c9a1c8 commit 7773035
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,10 @@
"require-dev": {
"pestphp/pest": "^1.21",
"phpstan/phpstan": "^1.2"
},
"config": {
"allow-plugins": {
"pestphp/pest-plugin": true
}
}
}
4 changes: 2 additions & 2 deletions src/Mira.php → src/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Mira;

class Mira
class Engine
{
/**
* @var string
Expand All @@ -19,7 +19,7 @@ class Mira
*
* @param string $viewsDirectory
* @param string $viewExtension
* @throws \Exception
* @throws DirectoryDoesNotExistException
*/
public function __construct(string $viewsDirectory, string $viewExtension = 'phtml')
{
Expand Down
8 changes: 4 additions & 4 deletions tests/ViewsTest.php
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<?php

use Mira\DirectoryDoesNotExistException;
use Mira\Mira;
use Mira\Engine;

beforeEach(function() {
$this->views = new Mira(__DIR__ . '/views');
$this->views = new Engine(__DIR__ . '/views');
});

it("throws exception", function () {
new Mira(__DIR__ . '/dir/does/not/exist');
new Engine(__DIR__ . '/dir/does/not/exist');
})->throws(DirectoryDoesNotExistException::class, 'Directory ' . __DIR__ . '/dir/does/not/exist' . ' does not exist');

it('exists', function() {
expect($this->views)->toBeInstanceOf(Mira::class);
expect($this->views)->toBeInstanceOf(Engine::class);
});

it("renders a view", function() {
Expand Down

0 comments on commit 7773035

Please sign in to comment.