/** * @group bug58072 */ public function testLockConfig() { $fileModContents = <<<EOQ <?PHP \t\$GLOBALS['sugar_config']['moduleInstaller']['test'] = true; \t\$manifest = array(); \t\$installdefs = array(); ?> EOQ; file_put_contents($this->fileLoc, $fileModContents); $ms = new MockModuleScanner(); $ms->config['test'] = false; $ms->lockConfig(); MSLoadManifest($this->fileLoc); $errors = $ms->checkConfig($this->fileLoc); $this->assertTrue(!empty($errors), "Not detected config change"); $this->assertFalse($ms->config['test'], "config was changed"); }
/** * @dataProvider phpSamples */ public function testPHPFile($content, $is_php) { $ms = new MockModuleScanner(); $this->assertEquals($is_php, $ms->isPHPFile($content), "Bad PHP file result"); }