Skip to content
Permalink
Browse files

Add basic tests

  • Loading branch information...
pactode committed Mar 12, 2019
1 parent 8650d15 commit 40b148bfe2f3c435851ae01f5db6847e0999b74c
Showing with 56 additions and 16 deletions.
  1. +1 −0 .gitignore
  2. +0 −16 tests/ExampleTest.php
  3. +49 −0 tests/JanitorTest.php
  4. +6 −0 tests/TestCase.php
@@ -1,2 +1,3 @@
vendor
composer.lock
.phpunit.result.cache

This file was deleted.

Oops, something went wrong.
@@ -0,0 +1,49 @@
<?php
namespace Signifly\Janitor\Tests;
use Signifly\Janitor\JWTProxy;
use Signifly\Janitor\PassportProxy;
use Signifly\Janitor\Facades\Janitor;
use Illuminate\Foundation\Testing\RefreshDatabase;
class JanitorTest extends TestCase
{
use RefreshDatabase;
/** @test */
public function it_returns_a_jwt_proxy()
{
$driver = Janitor::driver('jwt');
$this->assertInstanceOf(JWTProxy::class, $driver);
}
/** @test */
public function it_returns_a_passport_proxy()
{
$driver = Janitor::driver('passport');
$this->assertInstanceOf(PassportProxy::class, $driver);
}
/** @test */
public function it_register_routes()
{
$router = app('router');
Janitor::routes();
$this->assertEquals(5, $router->getRoutes()->count());
$routeNames = [
'janitor.login',
'janitor.refresh',
'janitor.logout',
'janitor.password.email',
'janitor.password.reset',
];
collect($router->getRoutes()->getRoutes())->each(function ($route) use ($routeNames) {
$this->assertContains($route->getName(), $routeNames);
});
}
}
@@ -3,6 +3,7 @@
namespace Signifly\Janitor\Tests;
use Illuminate\Database\Schema\Blueprint;
use Signifly\Janitor\JanitorServiceProvider;
use Orchestra\Testbench\TestCase as Orchestra;
abstract class TestCase extends Orchestra
@@ -25,6 +26,11 @@ public function getEnvironmentSetUp($app)
$app['config']->set('app.key', 'base64:9e0yNQB60wgU/cqbP09uphPo3aglW3iQJy+u4JQgnQE=');
}
protected function getPackageProviders($app)
{
return [JanitorServiceProvider::class];
}
protected function setUpDatabase()
{
$this->createUsersTable();

0 comments on commit 40b148b

Please sign in to comment.
You can’t perform that action at this time.