1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <?php
- namespace OSInet\Class_Grapher;
- require_once 'OSInet/Class_Grapher/Logger.php';
- require_once 'PHPUnit/Framework/TestCase.php';
- class LoggerTest extends \PHPUnit_Framework_TestCase {
-
- private $Logger;
-
- protected function setUp() {
- parent::setUp();
- $this->Logger = new Logger();
- }
-
- protected function tearDown() {
- $this->Logger = null;
- parent::tearDown();
- }
-
- public function test__construct() {
- $this->Logger->__construct(LOG_DEBUG);
- $this->assertEquals($this->Logger->debugLevel(), LOG_DEBUG);
- $this->Logger->__construct(LOG_EMERG - 1);
- $this->assertEquals($this->Logger->debugLevel(), LOG_EMERG);
- $this->Logger->__construct(LOG_DEBUG + 1);
- $this->assertEquals($this->Logger->debugLevel(), LOG_DEBUG);
- $this->Logger->__construct();
- $this->assertEquals($this->Logger->debugLevel(), LOG_WARNING);
- }
- public function testDebugLevel() {
- $this->assertEquals(LOG_WARNING, $this->Logger->debugLevel());
- $level = $this->Logger->debugLevel(LOG_EMERG);
- $this->assertEquals(LOG_WARNING, $level);
- $level = $this->Logger->debugLevel();
- $this->assertEquals(LOG_EMERG, $level);
- }
-
- public function testDebug() {
- $this->markTestSkipped("STDERR capture not available. Cannot test.");
- }
- }
|