Collections\Collection::count PHP Method

count() public method

public count ( )
    public function count()
    {
        return count($this->items);
    }

Usage Example

 public function test_clear_returns_an_empty_collection()
 {
     $col = new Collection('TestClassA', [new TestClassA(1)]);
     //col will have one
     $this->assertEquals(1, $col->count());
     //empty should have no items
     $empty = $col->clear();
     $this->assertEquals(0, $empty->count());
     //col should remain unchanged
     $this->assertEquals(1, $col->count());
 }
All Usage Examples Of Collections\Collection::count