private function dirChmod($mode) { $dir = MockTest::mockDir('anyDir'); chmod($dir, $mode); MockTest::mockConf('logFileDir', $dir); MockTest::mockConf('createLogFile', true); }
public function testCreateLogFile() { $logFileDir = dirname(__DIR__) . '/logs'; MockTest::mockConf('createLogFile', true); MockTest::mockConf('logFileDir', $logFileDir); $file = "{$logFileDir}/{$this->logFileArray[0]['fileName']}"; $this->assertTrue(file_exists($file)); }
public function testLoadUserMessageWhenUserIsReporting() { // Clear counter to call again destructor MockTest::injectStatic($this->_controller, 'count'); MockTest::mockConf('userReporting', E_ALL); MockTest::inject($this->_controller, '_logFile', $this->mockLogFile("once")); MockTest::inject($this->_controller, '_display', $this->mockDisplay(2)); $this->_controller->__destruct(); }
public function testGetInf() { $this->assertEquals(date('G:i:s', time()), $this->getInf('time')); $path = 'path/to/logs'; MockTest::mockConf('logFileDir', $path); $this->assertEquals($path, $this->getInf('path')); MockTest::mockConf('createLogFile', false); $this->assertEquals('no', $this->getInf('log')); MockTest::mockConf('createLogFile', true); $this->assertEquals('yes', $this->getInf('log')); }