/** * Tests the value of the last params in the closure in method filter. * Case of a scalar value. */ public function testFilterWithScalarByKeyAndObjects() { $data = array('a', 'b'); $objects = new resources\Foos($data); $result = $objects->filter(function ($value, $key, $objects) { return $objects[$key] === 'b'; }); $this->assertInstanceOf(get_class($objects), $result); $this->assertCount(1, $result); $this->assertSame($data[1], $result[1]); }