Beispiel #1
0
 /**
  * @covers Timing::getEntriesByType
  */
 public function testGetEntriesByType()
 {
     $timing = new Timing();
     $timing->mark('mark_a');
     usleep(100);
     $timing->mark('mark_b');
     usleep(100);
     $timing->mark('mark_c');
     $timing->measure('measure_a', 'mark_a', 'mark_b');
     $timing->measure('measure_b', 'mark_b', 'mark_c');
     $marks = array_map(function ($entry) {
         return $entry['name'];
     }, $timing->getEntriesByType('mark'));
     $this->assertEquals(array('requestStart', 'mark_a', 'mark_b', 'mark_c'), $marks);
     $measures = array_map(function ($entry) {
         return $entry['name'];
     }, $timing->getEntriesByType('measure'));
     $this->assertEquals(array('measure_a', 'measure_b'), $measures);
 }