public function testCanReturnAnArrayWithoutSomeValues()
 {
     $array = array('foo', 'foo', 'bar', 'bis', 'bar', 'bis', 'ter');
     $array = Arrays::without($array, 'foo', 'bar');
     $this->assertEquals(array(3 => 'bis', 5 => 'bis', 6 => 'ter'), $array);
     $this->assertNotContains('foo', Arrays::without($array, 'foo', 'bar'));
     $this->assertNotContains('bar', Arrays::without($array, 'foo', 'bar'));
     // new use case
     $exclusion = array('foo', 'bar');
     $this->assertNotContains('foo', Arrays::without($array, $exclusion));
     $this->assertNotContains('bar', Arrays::without($array, $exclusion));
 }
Exemple #2
0
 /**
  * @return \Rx\Disposable\CallbackDisposable|\Rx\DisposableInterface
  */
 public function rejectToBottom()
 {
     return $this->reject(false)->flatMap(function () {
         return $this->channel->publish($this->serializer->serialize($this->data), Arrays::without($this->labels, 'retried', 'exchange'), $this->getLabel('exchange'), $this->name);
     });
 }
 public function testCanReturnAnArrayWithoutSomeValues()
 {
     $array = array('foo', 'foo', 'bar', 'bis', 'bar', 'bis', 'ter');
     $array = Arrays::without($array, 'foo', 'bar');
     $this->assertEquals(array(3 => 'bis', 5 => 'bis', 6 => 'ter'), $array);
 }