Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/PHPUnit/Integration/LogTest.php')
-rw-r--r--tests/PHPUnit/Integration/LogTest.php40
1 files changed, 14 insertions, 26 deletions
diff --git a/tests/PHPUnit/Integration/LogTest.php b/tests/PHPUnit/Integration/LogTest.php
index 8934e31e85..386b348fda 100644
--- a/tests/PHPUnit/Integration/LogTest.php
+++ b/tests/PHPUnit/Integration/LogTest.php
@@ -5,6 +5,10 @@
* @link http://piwik.org
* @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
*/
+
+namespace Piwik\Tests\Integration;
+
+use Exception;
use Piwik\Common;
use Piwik\Config;
use Piwik\Db;
@@ -17,12 +21,10 @@ use Piwik\Tests\Framework\TestCase\IntegrationTestCase;
require_once PIWIK_INCLUDE_PATH . '/tests/resources/TestPluginLogClass.php';
/**
- * Class Core_LogTest
- *
* @group Core
* @group Core_LogTest
*/
-class Core_LogTest extends IntegrationTestCase
+class LogTest extends IntegrationTestCase
{
const TESTMESSAGE = 'test%smessage';
const STRING_MESSAGE_FORMAT = '[%tag%] %message%';
@@ -32,9 +34,9 @@ class Core_LogTest extends IntegrationTestCase
'screen' => 'dummy error message<br />
<br />
--&gt; To temporarily debug this error further, set const PIWIK_PRINT_ERROR_BACKTRACE=true; in index.php',
- 'file' => '[Core_LogTest] LogTest.php(166): dummy error message
+ 'file' => '[Piwik\Tests\Integration\LogTest] LogTest.php(160): dummy error message
dummy backtrace',
- 'database' => '[Core_LogTest] LogTest.php(166): dummy error message
+ 'database' => '[Piwik\Tests\Integration\LogTest] LogTest.php(160): dummy error message
dummy backtrace'
);
@@ -46,9 +48,9 @@ dummy backtrace'
<br /><br />Backtrace --&gt;<div style="font-family:Courier;font-size:10pt"><br />
dummy backtrace</div><br />
</pre></div><br />',
- 'file' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+ 'file' => '[Piwik\Tests\Integration\LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
dummy backtrace',
- 'database' => '[Core_LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
+ 'database' => '[Piwik\Tests\Integration\LogTest] dummyerrorfile.php(145): Unknown error (102) - dummy error string
dummy backtrace'
);
@@ -101,8 +103,6 @@ dummy backtrace'
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsString($backend)
@@ -114,12 +114,10 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::TESTMESSAGE, $formatMessage = true, $tag = __CLASS__);
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsSprintfString($backend)
@@ -131,12 +129,10 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, sprintf(self::TESTMESSAGE, " subst "), $formatMessage = true, $tag = __CLASS__);
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsError($backend)
@@ -149,13 +145,11 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::$expectedErrorOutput[$backend], $formatMessage = false, $tag = __CLASS__);
$this->checkBackend('screen', self::$expectedErrorOutput['screen']); // errors should always written to the screen
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingWorksWhenMessageIsException($backend)
@@ -168,13 +162,11 @@ dummy backtrace'
$this->screenOutput = ob_get_contents();
ob_end_clean();
- $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = 'Core_LogTest');
+ $this->checkBackend($backend, self::$expectedExceptionOutput[$backend], $formatMessage = false, $tag = __CLASS__);
$this->checkBackend('screen', self::$expectedExceptionOutput['screen']); // errors should always written to the screen
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLoggingCorrectlyIdentifiesPlugin($backend)
@@ -190,8 +182,6 @@ dummy backtrace'
}
/**
- * @group Core
- *
* @dataProvider getBackendsToTest
*/
public function testLogMessagesIgnoredWhenNotWithinLevel($backend)
@@ -208,7 +198,6 @@ dummy backtrace'
}
/**
- * @group Core
* @dataProvider getBackendsToTest
*/
public function testLogMessagesAreTrimmed($backend)
@@ -300,5 +289,4 @@ dummy backtrace'
$path = PIWIK_INCLUDE_PATH . '/tmp/logs/piwik.test.log';
return $path;
}
-
-} \ No newline at end of file
+}