iccrm-wip /fuel/core/tests/log.php

Language PHP Lines 113
MD5 Hash e2c395f92f1721c2f34510f26c3e3352 Estimated Cost $1,114 (why?)
Repository https://bitbucket.org/sriedel/iccrm-wip.git View Raw File View Project SPDX
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
/**
 * Part of the Fuel framework.
 *
 * @package    Fuel
 * @version    1.0
 * @author     Fuel Development Team
 * @license    MIT License
 * @copyright  2010 - 2012 Fuel Development Team
 * @link       http://fuelphp.com
 */

namespace Fuel\Core;

/**
 * Log class tests
 *
 * @group Core
 * @group Log
 */
class Test_Log extends TestCase
{

	public function setUp()
	{
		$this->log_threshold = \Config::get('log_threshold');
		// set the log threshold to a known value
		\Config::set('log_threshold', Fuel::L_DEBUG);
	}

	public function tearDown()
	{
		\Config::set('log_threshold', $this->log_threshold);
	}

	/**
	 * Test for Log::info()
	 *
	 * @test
	 */
	public function test_info()
	{
		$output = Log::info('testing log info');
		$this->assertFalse($output);	// log level is set to DEBUG
	}

	/**
	 * Test for Log::debug()
	 *
	 * @test
	 */
	public function test_debug()
	{
		$output = Log::debug('testing log debug');
		$this->assertTrue($output);
	}

	/**
	 * Test for Log::error()
	 *
	 * @test
	 */
	public function test_error()
	{
		$output = Log::error('testing log error');
		$this->assertTrue($output);
	}

	/**
	 * Test for Log::info()
	 *
	 * @test
	 */
	public function test_info_method()
	{
		$output = Log::info('testing log info', 'Log::info');
		$this->assertFalse($output);	// default log level is DEBUG
	}

	/**
	 * Test for Log::debug()
	 *
	 * @test
	 */
	public function test_debug_method()
	{
		$output = Log::debug('testing log debug', 'Log::debug');
		$this->assertTrue($output);
	}

	/**
	 * Test for Log::error()
	 *
	 * @test
	 */
	public function test_error_method()
	{
		$output = Log::error('testing log error', 'Log::error');
		$this->assertTrue($output);
	}

	/**
	 * Test for Log::write()
	 *
	 * @test
	 */
	public function test_write_custom_level()
	{
		$output = Log::write('Custom', 'testing custom level log', 'Log::write');
		$this->assertTrue($output);
	}
}
Back to Top