mirror of
https://github.com/nothingworksinc/ticketbeast.git
synced 2026-01-27 19:45:24 +00:00
28 lines
735 B
PHP
28 lines
735 B
PHP
<?php
|
|
|
|
namespace Tests\Feature;
|
|
|
|
use App\Invitation;
|
|
use Tests\TestCase;
|
|
use App\Facades\InvitationCode;
|
|
use Illuminate\Foundation\Testing\WithFaker;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
class InvitePromoterTest extends TestCase
|
|
{
|
|
use RefreshDatabase;
|
|
|
|
/** @test */
|
|
function inviting_a_promoter_via_the_cli()
|
|
{
|
|
InvitationCode::shouldReceive('generate')->andReturn('TESTCODE1234');
|
|
|
|
$this->artisan('invite-promoter', ['email' => 'john@example.com']);
|
|
|
|
$this->assertEquals(1, Invitation::count());
|
|
$invitation = Invitation::first();
|
|
$this->assertEquals('john@example.com', $invitation->email);
|
|
$this->assertEquals('TESTCODE1234', $invitation->code);
|
|
}
|
|
}
|