Skip to content

Instantly share code, notes, and snippets.

View DCzajkowski's full-sized avatar

Dariusz Czajkowski DCzajkowski

View GitHub Profile
<?php
namespace Tests\Feature\Auth;
use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class LoginTest extends TestCase
<?xml version="1.0" encoding="UTF-8"?>
<phpunit>
<!-- ... -->
<php>
<!-- ... -->
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
<?php
// ...
class LoginTest extends TestCase
{
// ...
public function test_user_can_login_with_correct_credentials()
{
<?php
// ...
class LoginTest extends TestCase
{
// ...
public function test_user_cannot_view_a_login_form_when_authenticated()
{
<?php
factory(User::class)->create(); // Creates a user and inserts them into the database
factory(User::class)->make(); // Creates a user object
<?php
User::create([
'name' => 'John Doe',
'email' => 'john@example.com',
'password' => bcrypt('secret'),
]);
<?php
// ...
class LoginTest extends TestCase
{
public function test_user_can_view_a_login_form()
{
$response = $this->get('/login');
<?php
namespace Tests\Feature\Auth;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class LoginTest extends TestCase
{
<?php
namespace Tests\Feature\Auth;
use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;
class LoginTest extends TestCase
{
@DCzajkowski
DCzajkowski / .bash_profile
Last active July 6, 2020 10:46
My bash configuration
# aliases
alias ~="cd ~"
alias ..="cd .."
alias cd..="cd .."
alias ls="ls -G"
alias ll="ls -alh" # -S for sort by size
alias rmf="rm -rf"
alias bat="bat --paging never"
alias sourceb="source ~/.bash_profile"