Last active
July 19, 2024 03:21
-
-
Save dhakalsuresh/edd29d495b9f2bac8190798b75e32ec3 to your computer and use it in GitHub Desktop.
Unit test for Laravel join
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$this->connectionMock->shouldReceive('table')->once()->andReturn($this->builderMock); | |
$this->builderMock->shouldReceive('join')->with('table_name AS sa', m::on(function ($join) { | |
$this->builderMock->shouldReceive('where')->andReturn($this->builderMock); | |
$query = $this->builderMock->shouldReceive('on') | |
->andReturn($this->builderMock) | |
->getMock(); | |
$join($query); | |
return true; | |
}))->andReturn($this->builderMock); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment