public function testVariableVariablesJoinToSubScope()
{
foreach ([['a', 'b'], ['dd', 'ee'], ['abc', 'qw112']] as $varNames) {
$this->assertRequestIsCorrect(function (IQueryable $queryable) use($varNames) {
return $queryable->join($queryable->orderByAscending(function ($i) use($varNames) {
return ${$varNames[0]};
})->select(function ($i) use($varNames) {
return ${$varNames[1]};
})->take(50))->to(function ($o, $i) use($varNames) {
return [${$varNames[0]}, ${$varNames[1]}];
});
}, <<<ENG
Join with: [
Order according to: { return \${$varNames['0']}; } with parameters: [\$this, \$varNames] asc or desc
Map according to: { return \${$varNames['1']}; } with parameters: [\$this, \$varNames]
Starting from and up to the specified element
] and correlate the values according to: { return [\${$varNames['0']}, \${$varNames['1']}]; } with parameters: [\$this, \$varNames]
Get the elements as itself
ENG
);
}
}