Skip to content

Commit

Permalink
First feature test
Browse files Browse the repository at this point in the history
  • Loading branch information
Larzs committed Feb 2, 2019
1 parent 43ad54d commit e68940b
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 26 deletions.
1 change: 1 addition & 0 deletions phpunit.xml
Expand Up @@ -21,5 +21,6 @@
</filter>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
40 changes: 40 additions & 0 deletions tests/Feature/InvytrTest.php
@@ -0,0 +1,40 @@
<?php
namespace GlaivePro\Invytr\Tests\Feature;

use GlaivePro\Invytr\Tests\TestCase;
use GlaivePro\Invytr\Tests\Models\User;
use GlaivePro\Invytr\Notifications\SetPassword;
use Illuminate\Support\Facades\Notification;

class InvytrTest extends TestCase
{
/**
* Setup the test environment.
*/
protected function setUp()
{
parent::setUp();

$this->loadLaravelMigrations();
}

/**
* Check that the mail has been sent
* @return void
*/
public function testInvite()
{
Notification::fake();

$user = new User;

$user->email = 'user@example.com';

\Invytr::invite($user);

// Assert a notification was sent to the given users...
Notification::assertSentTo(
$user, SetPassword::class
);
}
}
9 changes: 1 addition & 8 deletions tests/Unit/MiddlewareTest.php
Expand Up @@ -7,12 +7,5 @@

class MiddlewareTest extends TestCase
{
/**
* Check that the multiply method returns correct result
* @return void
*/
public function testTest()
{
$this->assertSame(1,1);
}

}
18 changes: 0 additions & 18 deletions tests/Unit/SetPasswordTest.php

This file was deleted.

11 changes: 11 additions & 0 deletions tests/models/User.php
@@ -0,0 +1,11 @@
<?php

namespace GlaivePro\Invytr\Tests\Models;

use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;

class User extends Authenticatable
{
use Notifiable;
}

0 comments on commit e68940b

Please sign in to comment.