/**
  * Test filtering collection elements
  *
  * @return void
  */
 public function testFilter()
 {
     $filtered = $this->collection->filter(function ($value, $key) {
         return is_string($key);
     });
     $this->assertAttributeNotEmpty('elements', $filtered);
     $this->assertAttributeCount(2, 'elements', $filtered);
 }
Exemplo n.º 2
0
 /**
  * Return completed processes
  *
  * @return Collection
  */
 public function getCompleted()
 {
     return $this->queue->filter(function (Process $process) {
         return $process->isTerminated();
     });
 }