file = stream_get_meta_data($tmpFile)['uri']; fclose($tmpFile); $tmpFile = fopen($this->file, 'w+'); fwrite($tmpFile, "\n"); fclose($tmpFile); $this->conf = new LAMCfgMain($this->file); } /** * Cleans up the environment after running a test. */ protected function tearDown(): void { $this->conf = null; //unlink($this->file); } /** * Mail related settings */ public function testMail() { $this->conf->mailServer = 'server:123'; $this->conf->mailPassword = 'pwd123'; $this->conf->mailUser = 'user123'; $this->conf->save(); $this->conf = new LAMCfgMain($this->file); $this->assertEquals('server:123', $this->conf->mailServer); $this->assertEquals('pwd123', $this->conf->mailPassword); $this->assertEquals('user123', $this->conf->mailUser); } /** * License related settings. */ public function testLicense() { $this->assertEquals(LAMCfgMain::LICENSE_WARNING_SCREEN, $this->conf->getLicenseWarningType()); $this->conf->licenseEmailTo = 'TO'; $this->conf->licenseEmailFrom = 'FROM'; $this->conf->licenseEmailDateSent = 'date'; $this->conf->licenseWarningType = LAMCfgMain::LICENSE_WARNING_ALL; $this->conf->setLicenseLines(array('123', '456')); $this->conf->save(); $this->conf = new LAMCfgMain($this->file); $this->assertEquals('TO', $this->conf->licenseEmailTo); $this->assertEquals('FROM', $this->conf->licenseEmailFrom); $this->assertEquals('date', $this->conf->licenseEmailDateSent); $this->assertEquals(LAMCfgMain::LICENSE_WARNING_ALL, $this->conf->licenseWarningType); $this->assertEquals(array('123', '456'), $this->conf->getLicenseLines()); } }