Esempio n. 1
0
 public function testCanReturnAnArrayWithoutSomeValues()
 {
     $array = ['foo', 'foo', 'bar', 'bis', 'bar', 'bis', 'ter'];
     $array = Arr::without($array, 'foo', 'bar');
     $this->assertEquals([3 => 'bis', 5 => 'bis', 6 => 'ter'], $array);
     $this->assertNotContains('foo', Arr::without($array, 'foo', 'bar'));
     $this->assertNotContains('bar', Arr::without($array, 'foo', 'bar'));
     // new use case
     $exclusion = ['foo', 'bar'];
     $this->assertNotContains('foo', Arr::without($array, $exclusion));
     $this->assertNotContains('bar', Arr::without($array, $exclusion));
 }