Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[7.x] Cast primary key to string when $keyType is string #33930

Merged
merged 3 commits into from
Aug 19, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix test
  • Loading branch information
stevethomas committed Aug 19, 2020
commit 6b53bf6446076ef9c1b1b33bb4df3a362baef4d6
6 changes: 4 additions & 2 deletions tests/Database/DatabaseEloquentBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ protected function tearDown(): void
public function testFindMethod()
{
$builder = m::mock(Builder::class.'[first]', [$this->getMockQueryBuilder()]);
$builder->setModel($this->getMockModel());
$model = $this->getMockModel();
$builder->setModel($model);
$model->shouldReceive('getKeyType')->once()->andReturn('int');
$builder->getQuery()->shouldReceive('where')->once()->with('foo_table.foo', '=', 'bar');
$builder->shouldReceive('first')->with(['column'])->andReturn('baz');

Expand Down Expand Up @@ -1093,7 +1095,7 @@ public function testWhereKeyNotMethodWithStringZero()
$builder->getQuery()->shouldReceive('where')->once()->with($keyName, '!=', (string) $int);

$builder->whereKeyNot($int);
}
}

public function testWhereKeyNotMethodWithInt()
{
Expand Down