Skip to content

Commit

Permalink
Merge branch '3.2'
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json

Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 17, 2015
2 parents 836e97e + a8603f1 commit aad3afe
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 17 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"php": ">=5.6.0",
"laravel/framework": "~5.3.0",
"orchestra/database": "~3.3.0",
"fzaninotto/faker": "~1.4",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
Expand Down
24 changes: 12 additions & 12 deletions fixture/config/auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses "session" storage and the Eloquent user source.
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user "source". This defines how the
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
Expand All @@ -38,21 +38,21 @@
'guards' => [
'web' => [
'driver' => 'session',
'source' => 'users',
'provider' => 'users',
],

// 'api' => [
// 'driver' => 'token',
// 'source' => 'users',
// ],
'api' => [
'driver' => 'token',
'provider' => 'users',
],
],

/*
|--------------------------------------------------------------------------
| User Sources
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user "source". This defines how the
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
Expand All @@ -64,7 +64,7 @@
|
*/

'sources' => [
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
Expand Down Expand Up @@ -97,8 +97,8 @@

'passwords' => [
'users' => [
'source' => 'users',
'email' => 'emails.password',
'provider' => 'users',
'email' => 'auth.emails.password',
'table' => 'password_resets',
'expire' => 60,
],
Expand Down
4 changes: 2 additions & 2 deletions src/TestCaseInterface.php → src/Contracts/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php namespace Orchestra\Testbench;
<?php namespace Orchestra\Testbench\Contracts;

use Illuminate\Contracts\Auth\Authenticatable;

interface TestCaseInterface
interface TestCase
{
/**
* Assert that the session has a given list of values.
Expand Down
7 changes: 5 additions & 2 deletions src/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
<?php namespace Orchestra\Testbench;

use Mockery;
use Orchestra\Testbench\Traits\WithFactories;
use Orchestra\Testbench\Traits\ApplicationTrait;
use Illuminate\Foundation\Testing\Concerns\ImpersonatesUsers;
use Illuminate\Foundation\Testing\Concerns\MakesHttpRequests;
use Orchestra\Testbench\Contracts\TestCase as TestCaseContract;
use Illuminate\Foundation\Testing\Concerns\InteractsWithConsole;
use Illuminate\Foundation\Testing\Concerns\InteractsWithSession;
use Illuminate\Foundation\Testing\Concerns\InteractsWithDatabase;
use Illuminate\Foundation\Testing\Concerns\InteractsWithContainer;
use Illuminate\Foundation\Testing\Concerns\MocksApplicationServices;

abstract class TestCase extends \PHPUnit_Framework_TestCase implements TestCaseInterface
abstract class TestCase extends \PHPUnit_Framework_TestCase implements TestCaseContract
{
use ApplicationTrait,
InteractsWithContainer,
Expand All @@ -19,7 +21,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase implements TestCaseI
InteractsWithConsole,
InteractsWithDatabase,
InteractsWithSession,
MocksApplicationServices;
MocksApplicationServices,
WithFactories;

/**
* The Illuminate application instance.
Expand Down
20 changes: 20 additions & 0 deletions src/Traits/WithFactories.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php namespace Orchestra\Testbench\Traits;

use Illuminate\Database\Eloquent\Factory as ModelFactory;

trait WithFactories
{
/**
* Load model factories from path.
*
* @param string $path
*
* @return $this
*/
protected function withModelFactories($path)
{
$this->app->make(ModelFactory::class)->load($path);

return $this;
}
}
2 changes: 1 addition & 1 deletion tests/TestCaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function testCreateApplicationMethod()
$stub = new StubTestCase();
$app = $stub->createApplication();

$this->assertInstanceOf('\Orchestra\Testbench\TestCaseInterface', $stub);
$this->assertInstanceOf('\Orchestra\Testbench\Contracts\TestCase', $stub);
$this->assertInstanceOf('\Illuminate\Foundation\Application', $app);
$this->assertEquals('UTC', date_default_timezone_get());
$this->assertEquals('testing', $app['env']);
Expand Down

0 comments on commit aad3afe

Please sign in to comment.