Skip to content

Commit

Permalink
Merge branch '3.1' into 3.2
Browse files Browse the repository at this point in the history
# Conflicts:
#	composer.json
#	src/TestCase.php

Signed-off-by: crynobone <crynobone@gmail.com>
  • Loading branch information
crynobone committed Dec 16, 2015
2 parents af2466e + e9cb488 commit adbde65
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 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.5.0",
"laravel/framework": "~5.2.0",
"orchestra/database": "~3.2.0",
"fzaninotto/faker": "~1.4",
"symfony/css-selector": "2.8.*|3.0.*",
"symfony/dom-crawler": "2.8.*|3.0.*"
},
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;
}
}

0 comments on commit adbde65

Please sign in to comment.