Example #1
0
 public function callbackProvider()
 {
     return ['array callback' => [[1], 1, 0], 'iterator aggregate callback' => [new \ArrayObject([1]), 1, 0], 'iterator callback' => [new \ArrayIterator([1]), 1, 0], 'natural interface callback' => [P\Seq([1]), 1, 0]];
 }
Example #2
0
 public function orderProvider()
 {
     $source = [1, 2, 3];
     $output = '321';
     return ['[1,2,3]' => [$source, $output], 'ArrayObject(1,2,3)' => [new \ArrayObject($source), $output], 'ArrayIterator(1,2,3)' => [new \ArrayIterator($source), $output], 'Seq(1,2,3)' => [P\Seq($source), $output]];
 }
Example #3
0
 public function orderProvider()
 {
     $source = [1, 2, 3];
     $expected = '321';
     return ['[1,2,3]' => [$source, $expected], 'ArrayObject([1,2,3])' => [new \ArrayObject($source), $expected], 'ArrayIterator([1,2,3])' => [new \ArrayIterator($source), $expected], 'JAI([1,2,3])' => [new JustAnIterator($source), $expected], 'Seq(1,2,3)' => [P\Seq($source), $expected]];
 }
Example #4
0
 public function valueProvider()
 {
     // TODO: Figure out how to add a generator to this without it expiring after the first test.
     return ['[]' => [[]], '[1,2,3]' => [[1, 2, 3]], 'Some(1)' => [P\Some(1)], 'None' => [P\None()], 'Array({one:1, two: 2})' => [['one' => 1, 'two' => 2]], 'ArrayObject({one:1, two: 2})' => [new \ArrayObject(['one' => 1, 'two' => 2])], 'ArrayIterator({one:1, two: 2})' => [new \ArrayIterator(['one' => 1, 'two' => 2])], 'JustAIterator({one:1, two: 2})' => [new JustAnIterator(['one' => 1, 'two' => 2])], 'S[]' => [testNew([])], 'S[1,2,3]' => [testNew([1, 2, 3])]];
 }
Example #5
0
 public function callbackProvider()
 {
     $source = [1];
     return ['array callback' => [$source, $source[0], 0], 'iterator aggregate callback' => [new \ArrayObject($source), $source[0], 0], 'iterator callback' => [new \ArrayIterator($source), $source[0], 0], 'natural interface callback' => [P\Seq($source), $source[0], 0], 'just an iterator' => [new JustAnIterator($source), $source[0], 0]];
 }