mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
theme class test added for getThemeLayout().
This commit is contained in:
@@ -935,7 +935,7 @@
|
||||
$result = $this->e107::isInstalled('user');
|
||||
|
||||
// var_dump($result);
|
||||
$this->assertTrue($res);
|
||||
$this->assertTrue($result);
|
||||
}
|
||||
/*
|
||||
public function testIni_set()
|
||||
|
174
tests/unit/e_sessionTest.php
Normal file
174
tests/unit/e_sessionTest.php
Normal file
@@ -0,0 +1,174 @@
|
||||
<?php
|
||||
/**
|
||||
* e107 website system
|
||||
*
|
||||
* Copyright (C) 2008-2018 e107 Inc (e107.org)
|
||||
* Released under the terms and conditions of the
|
||||
* GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
class e_sessionTest extends \Codeception\Test\Unit
|
||||
{
|
||||
/*
|
||||
public function testSetOption()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetOption()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetDefaultSystemConfig()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGet()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSet()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testIs()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testHas()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testHasData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testClear()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testClearData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetConfig()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetNamespaceKey()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetOptions()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testInit()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testStart()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetSessionId()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetSessionId()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetSaveMethod()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testSetSessionName()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetSessionName()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testValidateSessionCookie()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testCookieDelete()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testValidate()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetValidateData()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testGetFormToken()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testCheckFormToken()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testClose()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testEnd()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testDestroy()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public function testReplaceRegistry()
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
115
tests/unit/e_themeTest.php
Normal file
115
tests/unit/e_themeTest.php
Normal file
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
/**
|
||||
* Created by PhpStorm.
|
||||
* User: Wiz
|
||||
* Date: 1/24/2019
|
||||
* Time: 9:21 AM
|
||||
*/
|
||||
|
||||
|
||||
class e_themeTest extends \Codeception\Test\Unit
|
||||
{
|
||||
|
||||
/** @var e_theme */
|
||||
private $tm;
|
||||
|
||||
protected function _before()
|
||||
{
|
||||
// require_once(e_HANDLER."e_marketplace.php");
|
||||
|
||||
try
|
||||
{
|
||||
$this->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()
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
}
|
Reference in New Issue
Block a user