Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Resetting Log to avoid sending stuff to stdout and stderr when runnin…
…g the tests.
  • Loading branch information
renan committed Apr 17, 2014
1 parent 18d7edb commit aec2536
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tests/TestCase/Error/ErrorHandlerTest.php
Expand Up @@ -49,6 +49,8 @@ public function setUp() {
Configure::write('debug', true);

$this->_logger = $this->getMock('Cake\Log\LogInterface');

Log::reset();
Log::config('error_test', [
'engine' => $this->_logger
]);
Expand All @@ -61,7 +63,7 @@ public function setUp() {
*/
public function tearDown() {
parent::tearDown();
Log::drop('error_test');
Log::reset();
if ($this->_restoreError) {
restore_error_handler();
restore_exception_handler();
Expand Down
5 changes: 5 additions & 0 deletions tests/TestCase/Log/LogTest.php
Expand Up @@ -26,6 +26,11 @@
*/
class LogTest extends TestCase {

public function setUp() {
parent::setUp();
Log::reset();
}

public function tearDown() {
parent::tearDown();
Log::reset();
Expand Down

0 comments on commit aec2536

Please sign in to comment.