diff --git a/tests/unit/e107Test.php b/tests/unit/e107Test.php index 0928b5eb5..3981be17e 100644 --- a/tests/unit/e107Test.php +++ b/tests/unit/e107Test.php @@ -935,7 +935,7 @@ $result = $this->e107::isInstalled('user'); // var_dump($result); - $this->assertTrue($res); + $this->assertTrue($result); } /* public function testIni_set() diff --git a/tests/unit/e_sessionTest.php b/tests/unit/e_sessionTest.php new file mode 100644 index 000000000..7228e89dc --- /dev/null +++ b/tests/unit/e_sessionTest.php @@ -0,0 +1,174 @@ +tm = $this->make('e_theme'); + $this->tm->__construct(); + } + catch (Exception $e) + { + $this->assertTrue(false, "Couldn't load e_theme object"); + } + } + + +/* + public function testCssAttribute() + { + + } + + public function testUpgradeThemeCode() + { + + } + + public function testGetThemeList() + { + + } + + public function testLoadLibrary() + { + + } + + public function testParse_theme_php() + { + + } + + public function testGetThemeInfo() + { + + }*/ + + public function testGetThemeLayout() + { + // FRONTPAGE = jumbotron_home + // /news = jumbotron_sidebar_right + // forum = jumbotron_full + + $tests = array( + 0 => array('url' => SITEURL."index.php", 'expected'=> 'jumbotron_home'), + 1 => array('url' => SITEURL."index.php?", 'expected'=> 'jumbotron_home'), + 2 => array('url' => SITEURL."index.php?fbclid=asdlkjasdlakjsdasd", 'expected'=> 'jumbotron_home'), + 3 => array('url' => SITEURL."index.php?utm_source=asdlkajsdasd&utm_medium=asdlkjasd", 'expected'=> 'jumbotron_home'), + 4 => array('url' => SITEURL."news", 'expected'=> 'jumbotron_sidebar_right'), + 5 => array('url' => SITEURL."forum", 'expected'=> 'jumbotron_full'), + 6 => array('url' => SITEURL."other/page", 'expected'=> 'jumbotron_sidebar_right'), + 7 => array('url' => SITEURL."news.php?5.3", 'expected'=> 'jumbotron_sidebar_right'), + ); + + + + foreach($tests as $var) + { + $result = $this->tm->getThemeLayout($var['url']); + $this->assertEquals($var['expected'],$result, "Wrong theme layout returned for ".$var['url']); + // echo $var['url']."\t\t\t".$result."\n\n"; + } + + + } +/* + public function testClearCache() + { + + } + + public function testGet() + { + + } + + public function testGetList() + { + + } + + public function testParse_theme_xml() + { + + } + */ + + + + }