Esempio n. 1
0
 /**
  * @dataProvider simpleArrayProvider
  */
 public function testFilter(array $array)
 {
     $callable = function ($value) {
         return 2 !== $value;
     };
     $filteredArray = array_filter($array, $callable);
     $ma = new MutableArray($array);
     $copiedMa = $ma->filter($callable);
     $this->assertTrue($copiedMa === $ma);
     $this->assertTrue($filteredArray === $ma->toArray());
 }
Esempio n. 2
0
 /**
  * @dataProvider simpleArrayProvider
  *
  * @param array $array
  */
 public function testFilter(array $array)
 {
     $callable = function ($value) {
         return 2 !== $value;
     };
     $arrayzy = new A($array);
     $resultArrayzy = $arrayzy->filter($callable);
     $resultArray = array_filter($array, $callable);
     $this->assertMutable($arrayzy, $resultArrayzy, $resultArray);
 }