Skip to content

Commit

Permalink
add unit test for this PR
Browse files Browse the repository at this point in the history
  • Loading branch information
mjauvin committed Dec 22, 2024
1 parent 10cfa66 commit 1698349
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Database/Concerns/HasRelationshipsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ public function testHasRelation()
$this->assertFalse($author->hasRelation('invalid'));
}

public function testDynamicRelationMethod()
{
$author = new Author();

$author->addDynamicMethod('dynamicMethodAsClosure', function () {});
$author->addDynamicMethod('dynamicClassMethod', [$author, 'isDatabaseReady']);

$this->assertFalse($author->hasRelation('dynamicMethodAsClosure'));
$this->assertFalse($author->hasRelation('dynamicClassMethod'));
}

public function testGetRelationType()
{
$author = new Author();
Expand Down

0 comments on commit 1698349

Please sign in to comment.