Esempio n. 1
0
 public function testQueryIsBuilt()
 {
     $query = m::mock(Builder::class);
     $tag = new Tag(['id' => 1]);
     $filter = new Filter($tag);
     $query->shouldReceive('leftJoin')->with('pages_tags as pt_without-0', m::on(function () {
         return true;
     }))->andReturnSelf()->shouldReceive('on')->with('pages.id', '=', 'pt_without-0.page_id')->andReturnSelf()->shouldReceive('on')->with('pt_without-0.tag_id', '=', $tag->getId())->andReturnSelf()->shouldReceive('whereNull')->with('pt_without-0.page_id');
     $filter->build($query);
 }