Laravel-Test-Helpers icon indicating copy to clipboard operation
Laravel-Test-Helpers copied to clipboard

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

Open chriszxv opened this issue 10 years ago • 0 comments

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...

chriszxv avatar Jun 16 '14 11:06 chriszxv