Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Petr Knap committed Sep 19, 2016
2 parents b93233c + deb225c commit b2bcb9b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Profiler/AdvancedProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class AdvancedProfiler extends SimpleProfiler
/**
* @var callable
*/
private static $postProcessor = null;
protected static $postProcessor = null;

/**
* Set post processor
Expand Down
8 changes: 8 additions & 0 deletions src/Profiler/SimpleProfiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public static function disable()
self::$enabled = false;
}

/**
* @return bool true if profiler is enabled, otherwise false
*/
public static function isEnabled()
{
return self::$enabled;
}

/**
* Start profiling
*
Expand Down
2 changes: 2 additions & 0 deletions tests/Profiler/SimpleProfilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function testEnable()
{
SimpleProfiler::enable();

$this->assertTrue(SimpleProfiler::isEnabled());
$this->assertTrue(SimpleProfiler::start());
$this->assertInstanceOf(get_class(new Profile()), SimpleProfiler::finish());
}
Expand All @@ -44,6 +45,7 @@ public function testDisable()
{
SimpleProfiler::disable();

$this->assertFalse(SimpleProfiler::isEnabled());
$this->assertFalse(SimpleProfiler::start());
$this->assertFalse(SimpleProfiler::finish());
}
Expand Down

0 comments on commit b2bcb9b

Please sign in to comment.