JeffreyWay / Laravel-Test-Helpers

Easier testing in Laravel.
https://packagist.org/packages/way/laravel-test-helpers
217 stars 40 forks source link

morphedByMany()->withTimestamps() makes assertRelationship() fail #60

Open chriszxv opened 10 years ago

chriszxv commented 10 years ago

I'm trying to write a test for this:

public function follows()
{
    return $this->morphedByMany('User', 'followable', 'follows', 'user_id', 'followable_id')->withTimestamps();
}

But when trying to use assertRelationship():

public function testMorphedByManyFollows()
{
    $this->assertRelationship('follows', 'User', 'morphedByMany');
}

I get the error:

PHP Fatal error:  Call to a member function withTimestamps() on a non-object in...