Ejemplo n.º 1
0
 /**
  * @covers  \Joomla\Profiler\Profiler::setStart
  *
  * @expectedException  \RuntimeException
  */
 public function testTheProfilerStartTimeAndMemoryCannotBeChangedIfAPointHasBeenMarked()
 {
     $time = microtime(true);
     $memory = memory_get_usage(false);
     $this->instance->mark('test');
     $this->instance->setStart($time, $memory);
 }
Ejemplo n.º 2
0
 /**
  * Tests the count method.
  *
  * @return  void
  *
  * @covers  \Joomla\Profiler\Profiler::count
  * @since   1.0
  */
 public function testCount()
 {
     $this->assertCount(0, $this->instance);
     $this->instance->mark('start');
     $this->instance->mark('foo');
     $this->instance->mark('end');
     $this->assertCount(3, $this->instance);
 }
Ejemplo n.º 3
0
 /**
  * Mark a profile point.
  *
  * @param   string  $name  The profile point name.
  *
  * @return  null|\Joomla\Profiler\ProfilerInterface
  *
  * @since   1.0
  */
 public function mark($name)
 {
     return $this->profiler ? $this->profiler->mark($name) : null;
 }