Skip to content

Commit

Permalink
Fix a test
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Apr 3, 2014
1 parent e485781 commit 0e12993
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 18 deletions.
3 changes: 0 additions & 3 deletions core/Tracker/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@ public function getIdLinkVisitAction()

public function writeDebugInfo()
{
if (!isset($GLOBALS['PIWIK_TRACKER_DEBUG']) || !$GLOBALS['PIWIK_TRACKER_DEBUG']) {
return false;
}
$type = self::getTypeAsString($this->getActionType());
Common::printDebug("Action is a $type,
Action name = " . $this->getActionName() . ",
Expand Down
2 changes: 1 addition & 1 deletion core/testMinimumPhpVersion.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
function Piwik_ShouldPrintBackTraceWithMessage()
{
$bool = (defined('PIWIK_PRINT_ERROR_BACKTRACE') && PIWIK_PRINT_ERROR_BACKTRACE)
|| (defined('PIWIK_TRACKER_DEBUG') && PIWIK_TRACKER_DEBUG);
|| !empty($GLOBALS['PIWIK_TRACKER_DEBUG']);
return $bool;
}

Expand Down
21 changes: 7 additions & 14 deletions tests/PHPUnit/Core/ReleaseCheckListTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class ReleaseCheckListTest extends PHPUnit_Framework_TestCase
public function setUp()
{
$this->globalConfig = _parse_ini_file(PIWIK_PATH_TEST_TO_ROOT . '/config/global.ini.php', true);

parent::setUp();
}
/**
Expand Down Expand Up @@ -88,7 +89,11 @@ public function testCheckThatConfigurationValuesAreProductionValues()
require_once PIWIK_INCLUDE_PATH . "/core/TaskScheduler.php";
$this->assertFalse(DEBUG_FORCE_SCHEDULED_TASKS);

$this->assertFalse(PIWIK_PRINT_ERROR_BACKTRACE);

// Check the index.php has "backtrace disabled"
$content = file_get_contents(PIWIK_INCLUDE_PATH . "/index.php");
$expected = "define('PIWIK_PRINT_ERROR_BACKTRACE', false);";
$this->assertTrue( false !== strpos($content, $expected), 'index.php should contain: ' . $expected);
}

private function _checkEqual($key, $valueExpected)
Expand Down Expand Up @@ -147,19 +152,7 @@ public function testProfilingDisabledInProduction()
public function testPiwikTrackerDebugIsOff()
{
$this->assertTrue(!isset($GLOBALS['PIWIK_TRACKER_DEBUG']));

$oldGet = $_GET;
$_GET = array('idsite' => 1);

// hiding echoed out message on empty request
ob_start();
include PIWIK_PATH_TEST_TO_ROOT . "/piwik.php";
ob_end_clean();

$_GET = $oldGet;

$this->assertEquals(0, \Piwik\Config::getInstance()->Tracker['debug']);
$this->assertTrue($GLOBALS['PIWIK_TRACKER_DEBUG'] === false);
$this->assertEquals(0, $this->globalConfig['Tracker']['debug']);
}

/**
Expand Down

0 comments on commit 0e12993

Please sign in to comment.