Skip to content

Commit

Permalink
Merge branch 'release/v0.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jstoone committed Dec 14, 2016
2 parents f239f25 + cdc0be5 commit 3ee2823
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/FuturePlanner.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function plan(array $attributes)
*
* @return Dixie\EloquentModelFuture\Models\Future
*/
public function for(Carbon $futureDate)
public function at(Carbon $futureDate)
{
$this->newFuture->commit_at = $futureDate;

Expand Down
11 changes: 6 additions & 5 deletions tests/FuturePlannerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
use Dixie\EloquentModelFuture\Models\Future;
use Dixie\EloquentModelFuture\Tests\TestCase;
use Dixie\EloquentModelFuture\FuturePlan;
use Dixie\EloquentModelFuture\Tests\User; use Dixie\EloquentModelFuture\Collections\FutureCollection;
use Dixie\EloquentModelFuture\Tests\User;
use Dixie\EloquentModelFuture\Collections\FutureCollection;
use Illuminate\Support\Facades\Auth;

class FuturePlannerTest extends TestCase
Expand All @@ -23,7 +24,7 @@ public function testItCanPlanAFuture()
$future = $user->future()->plan([
'name' => 'John Doe',
'email' => '[email protected]',
])->for($tomorrow);
])->at($tomorrow);

$this->assertInstanceOf(Future::class, $future);
$this->assertEquals($user->id, $future->futureable_id);
Expand All @@ -44,7 +45,7 @@ public function testItAssociatesAuthenticatedUserAsCreator()
$future = $user->future()->plan([
'name' => 'John Doe',
'email' => '[email protected]',
])->for($tomorrow);
])->at($tomorrow);

$this->assertNotNull($future->createe_user_id);
}
Expand Down Expand Up @@ -242,7 +243,7 @@ function auth()

public function user() {
if($this->shouldBeUnauthenticated) {
return null;
return null;
}

return User::create([
Expand All @@ -253,7 +254,7 @@ public function user() {

public function id() {
if($this->shouldBeUnauthenticated) {
return null;
return null;
}

return $this->user()->id;
Expand Down
5 changes: 3 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ public function tearDown()
protected function schema()
{
return $this->connection()->getSchemaBuilder();
}
}

protected function connection()
{
return Eloquent::getConnectionResolver()->connection();
Expand All @@ -73,7 +74,7 @@ protected function createFuturePlanFor(ModelFuture $model, $date, array $data =
$attributes = $data;
}

return $model->future()->plan($attributes)->for($date);
return $model->future()->plan($attributes)->at($date);
}

protected function createUser(array $data = [], $shouldOverride = false)
Expand Down

0 comments on commit 3ee2823

Please sign in to comment.