theme = new ThemeGenerator(); $this->output = $this->theme->createFileStructure($_POST); return $_POST; } /** * Test for ThemeGenerator::colorPicker * * @return void */ public function testColorPicker() { if ($GLOBALS['cfg']['ThemeGenerator']) { $output = $this->theme->colorPicker(); $this->assertContains('
' , $output); $this->assertContains('
' , $output); $this->assertContains('
' , $output); $this->assertContains('
' , $output); $this->assertContains('
' , $output); $this->assertContains('
' , $output); } } /** * Test for ThemeGenerator::form * * @return void */ public function testForm() { if ($GLOBALS['cfg']['ThemeGenerator']) { $output = $this->theme->form(); $this->assertContains('
' , $output); $this->assertContains('' , $output); } } /** * Test for ThemeGenerator::createJsonFile * * @return void */ public function testCreateJsonFile() { $name = $_POST['theme_name']; $this->assertFileIsReadable('themes/' . $name . '/theme.json'); $this->assertContains('"name": "' . $name . '",' , $this->output['json']); $this->assertContains('"version": "' . $_POST['version'] . '",' , $this->output['json']); $this->assertContains('"description": "' . $_POST['description'] . '",' , $this->output['json']); $this->assertContains('"author": "' . $_POST['author'] . '",' , $this->output['json']); $this->assertContains('"url": "' . $_POST['url'] . '",' , $this->output['json']); } /** * Return Layout file data * * @return string $this->output['layout'] layout.inc.php data string */ public function getLayoutData() { return $this->output['layout']; } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. * * @return void */ protected function tearDown() { $name = $_POST['theme_name']; unlink('themes/' . $name . '/theme.json'); unlink('themes/' . $name . '/layout.inc.php'); unlink('themes/' . $name . '/css/common.css.php'); unlink('themes/' . $name . '/css/navigation.css.php'); rmdir('themes/' . $name . '/css'); rmdir('themes/' . $name); } }