Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.4] Simplify built-in testing in prep for Dusk #16667

Merged
merged 16 commits into from
Dec 5, 2016
34 changes: 0 additions & 34 deletions src/Illuminate/Foundation/Testing/Concerns/ImpersonatesUsers.php

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,38 @@

namespace Illuminate\Foundation\Testing\Concerns;

use Illuminate\Contracts\Auth\Authenticatable as UserContract;

trait InteractsWithAuthentication
{
/**
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $driver
* @return $this
*/
public function actingAs(UserContract $user, $driver = null)
{
$this->be($user, $driver);

return $this;
}

/**
* Set the currently logged in user for the application.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param string|null $driver
* @return void
*/
public function be(UserContract $user, $driver = null)
{
$this->app['auth']->guard($driver)->setUser($user);

$this->app['auth']->shouldUse($driver);
}

/**
* Assert that the user is authenticated.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@

trait InteractsWithConsole
{
/**
* The last code returned by Artisan CLI.
*
* @var int
*/
protected $code;

/**
* Call artisan command and return code.
*
Expand All @@ -22,6 +15,6 @@ trait InteractsWithConsole
*/
public function artisan($command, $parameters = [])
{
return $this->code = $this->app[Kernel::class]->call($command, $parameters);
return $this->app[Kernel::class]->call($command, $parameters);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ protected function seeInDatabase($table, array $data, $connection = null)
return $this;
}

/**
* Assert that a given where condition does not exist in the database.
*
* @param string $table
* @param array $data
* @param string $connection
* @return $this
*/
protected function missingFromDatabase($table, array $data, $connection = null)
{
return $this->notSeeInDatabase($table, $data, $connection);
}

/**
* Assert that a given where condition does not exist in the database.
*
Expand All @@ -49,19 +36,6 @@ protected function missingFromDatabase($table, array $data, $connection = null)
* @return $this
*/
protected function dontSeeInDatabase($table, array $data, $connection = null)
{
return $this->notSeeInDatabase($table, $data, $connection);
}

/**
* Assert that a given where condition does not exist in the database.
*
* @param string $table
* @param array $data
* @param string $connection
* @return $this
*/
protected function notSeeInDatabase($table, array $data, $connection = null)
{
$database = $this->app->make('db');

Expand Down
Loading