Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ollieread committed Feb 4, 2025
1 parent 3edb42d commit 8d9d02b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/Database/DatabaseEloquentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ public function testNestedWhere()
$nestedQuery = m::mock(Builder::class);
$nestedRawQuery = $this->getMockQueryBuilder();
$nestedQuery->shouldReceive('getQuery')->once()->andReturn($nestedRawQuery);
$nestedQuery->shouldReceive('getEagerLoads')->once()->andReturn([]);
$model = $this->getMockModel()->makePartial();
$model->shouldReceive('newQueryWithoutRelationships')->once()->andReturn($nestedQuery);
$builder = $this->getBuilder();
Expand Down Expand Up @@ -1092,6 +1093,7 @@ public function testWhereNot()
$nestedQuery = m::mock(Builder::class);
$nestedRawQuery = $this->getMockQueryBuilder();
$nestedQuery->shouldReceive('getQuery')->once()->andReturn($nestedRawQuery);
$nestedQuery->shouldReceive('getEagerLoads')->once()->andReturn([]);
$model = $this->getMockModel()->makePartial();
$model->shouldReceive('newQueryWithoutRelationships')->once()->andReturn($nestedQuery);
$builder = $this->getBuilder();
Expand Down Expand Up @@ -1120,6 +1122,7 @@ public function testOrWhereNot()
$nestedQuery = m::mock(Builder::class);
$nestedRawQuery = $this->getMockQueryBuilder();
$nestedQuery->shouldReceive('getQuery')->once()->andReturn($nestedRawQuery);
$nestedQuery->shouldReceive('getEagerLoads')->once()->andReturn([]);
$model = $this->getMockModel()->makePartial();
$model->shouldReceive('newQueryWithoutRelationships')->once()->andReturn($nestedQuery);
$builder = $this->getBuilder();
Expand Down
2 changes: 1 addition & 1 deletion tests/Database/DatabaseEloquentModelTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ public function testWithWhereHasWithSpecificColumns()
public function testWithWhereHasWorksInNestedQuery()
{
$model = new EloquentModelWithWhereHasStub;
$instance = $model->newInstance()->newQuery()->with(fn ($q) => $q->withWhereHas('foo:diaa,fares'));
$instance = $model->newInstance()->newQuery()->where(fn (Builder $q) => $q->withWhereHas('foo:diaa,fares'));
$builder = m::mock(Builder::class);
$builder->shouldReceive('select')->once()->with(['diaa', 'fares']);
$this->assertNotNull($instance->getEagerLoads()['foo']);
Expand Down

0 comments on commit 8d9d02b

Please sign in to comment.