예제 #1
0
 /**
  * @covers  \Joomla\Profiler\Profiler::getIterator
  */
 public function testTheProfilerReturnsAnIterator()
 {
     // Create 3 points.
     $first = new ProfilePoint('test');
     $second = new ProfilePoint('second', 1.5, 1000);
     $third = new ProfilePoint('third', 2.5, 2000);
     $points = array($first, $second, $third);
     // Create a profiler and inject the points.
     $profiler = new Profiler('test', null, $points);
     $this->assertInstanceOf('\\ArrayIterator', $profiler->getIterator());
 }
예제 #2
0
 /**
  * Tests the count method.
  *
  * @return  void
  *
  * @covers  \Joomla\Profiler\Profiler::getIterator
  * @since   1.0
  */
 public function testGetIterator()
 {
     // Create 3 points.
     $first = new ProfilePoint('test');
     $second = new ProfilePoint('second', 1.5, 1000);
     $third = new ProfilePoint('third', 2.5, 2000);
     $points = array($first, $second, $third);
     // Create a profiler and inject the points.
     $profiler = new Profiler('test', null, $points);
     $iterator = $profiler->getIterator();
     $this->assertEquals($iterator->getArrayCopy(), $points);
 }