Skip to content

Commit

Permalink
Adds test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
huangdijia committed Feb 14, 2023
1 parent b40dd4a commit d9caa1f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/database/tests/ModelBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1176,7 +1176,10 @@ public function testWithCastsMethod()

public function testMixin()
{
ModelStub::mixin(new UserMixin());
\Hyperf\Database\Model\Builder::macro('testAbc', fn () => 'abc');
$this->assertEquals('abc', ModelStub::testAbc());

\Hyperf\Database\Model\Builder::mixin(new UserMixin());

$this->assertInstanceOf(\Hyperf\Database\Model\Builder::class, ModelStub::whereFoo());
$this->assertInstanceOf(\Hyperf\Database\Model\Builder::class, ModelStub::whereBar());
Expand Down

0 comments on commit d9caa1f

Please sign in to comment.