public num_of_segments ( ) : integer | ||
return | integer |
public function num_of_segments()
{
return count($this->segments);
}
/** * Test provide OutOfRangeException thrown as exception * * @expectedException OutOfRangeException */ public function testOORException() { // remove with following reindex $this->bread->remove(0, true); $this->assertEquals(1, $this->bread->num_of_segments()); // basic remove $this->bread->remove(0); $this->assertEquals(0, $this->bread->num_of_segments()); // refer to non existent element $this->bread->segment(10); }