1 | <?php |
||
8 | class CallableFunctionNamesTest extends PHPUnit_Framework_TestCase |
||
9 | { |
||
10 | /** |
||
11 | * Example that it's possible to use callable function names as arguments. |
||
12 | */ |
||
13 | public function testIt() |
||
14 | { |
||
15 | $result = Collection::from([2, 1]) |
||
16 | ->concat([3, 4]) |
||
17 | ->sort('\DusanKasan\Knapsack\compare') |
||
18 | ->values() |
||
19 | ->toArray(); |
||
20 | |||
21 | $expected = [1, 2, 3, 4]; |
||
22 | |||
23 | $this->assertEquals($expected, $result); |
||
24 | } |
||
25 | } |
||
26 |