Пример #1
0
 /**
  * Test sorting collection by callback
  *
  * @return void
  */
 public function testSort()
 {
     $this->collection->sort(function ($a, $b) {
         if ($a === $b) {
             return 0;
         }
         return $a > $b ? -1 : 1;
     });
     $this->assertAttributeEquals([3, 2, 1], 'elements', $this->collection);
 }