Skip to content

Commit

Permalink
Merge pull request laravel#770 from rappasoft/analysis-8mVlWK
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rappasoft authored Jun 27, 2017
2 parents 3c97e40 + ed46483 commit 4429a02
Showing 1 changed file with 33 additions and 31 deletions.
64 changes: 33 additions & 31 deletions tests/Frontend/Forms/LoggedOutFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
use Tests\BrowserKitTestCase;
use App\Models\Access\User\User;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Mail;
use Illuminate\Support\Facades\Event;
use App\Events\Frontend\Auth\UserLoggedIn;
use App\Mail\Frontend\Contact\SendContact;
use App\Events\Frontend\Auth\UserRegistered;
use Illuminate\Support\Facades\Notification;
use App\Notifications\Frontend\Auth\UserNeedsConfirmation;
use App\Notifications\Frontend\Auth\UserNeedsPasswordReset;
use App\Mail\Frontend\Contact\SendContact;
use Illuminate\Support\Facades\Mail;

/**
* Class LoggedOutFormTest.
Expand Down Expand Up @@ -341,33 +341,35 @@ public function testInvalidLoginCredentials()
->see('These credentials do not match our records.');
}

/**
* Test the contact forms required fields
*/
public function testContactFormRequiredFields() {
$this->visit('/contact')
->press(trans('labels.frontend.contact.button'))
->seePageIs('/contact')
->see('The name field is required.')
->see('The email field is required.')
->see('The message field is required.');
}

/**
* Test the contact form sends the mail
*/
public function testContactForm() {
Mail::fake();

$this->visit('/contact')
->type('Admin Istrator', 'name')
->type('admin@admin.com', 'email')
->type('1112223333', 'phone')
->type('Hello There', 'message')
->press(trans('labels.frontend.contact.button'))
->seePageIs('/contact')
->see(trans('alerts.frontend.contact.sent'));

Mail::assertSent(SendContact::class);
}
/**
* Test the contact forms required fields.
*/
public function testContactFormRequiredFields()
{
$this->visit('/contact')
->press(trans('labels.frontend.contact.button'))
->seePageIs('/contact')
->see('The name field is required.')
->see('The email field is required.')
->see('The message field is required.');
}

/**
* Test the contact form sends the mail.
*/
public function testContactForm()
{
Mail::fake();

$this->visit('/contact')
->type('Admin Istrator', 'name')
->type('admin@admin.com', 'email')
->type('1112223333', 'phone')
->type('Hello There', 'message')
->press(trans('labels.frontend.contact.button'))
->seePageIs('/contact')
->see(trans('alerts.frontend.contact.sent'));

Mail::assertSent(SendContact::class);
}
}

0 comments on commit 4429a02

Please sign in to comment.