num_of_segments() public method

num_of_segments: Returns the number of segments which are registered in the system.
public num_of_segments ( ) : integer
return integer
Example #1
0
 /**
  * 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);
 }