public function testArrayCount() { $arr = [1, 2, 3, 4, 5]; // Array with 5 elements $this->assertCount(5, $arr); // Asserting the count of the array is 5 }
public function testObjectCount() { $obj = new SplFixedArray(3); // Countable object with 3 elements $this->assertCount(3, $obj); // Asserting the count of the object is 3 }PHPUnit_Framework_Assert is a part of the PHPUnit framework and is available as a package library. The package can be installed using composer or downloaded from the PHPUnit official website.