public function testRepoIsPassedToTheClosureAsFirstParameter() { $repo = $this->getRepo('foobar'); $self = $this; $criterion = new Closure(function ($param) use($repo, $self) { $self->assertEquals($repo, $param); return $param === $repo; }); $this->assertTrue($criterion->matches($repo)); }