Laravel-Test-Helpers
Laravel-Test-Helpers copied to clipboard
morphedByMany()->withTimestamps() makes assertRelationship() fail
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...