Move IncludeMgr tests into their own test class,

originals left there since they look useful.
This commit is contained in:
nathangray 2017-02-06 13:57:31 -07:00
parent 74af635dac
commit b2ec0e9aa6

View File

@ -0,0 +1,45 @@
<?php
/**
* Test for IncludeMgr
*
* @link http://www.egroupware.org
* @author Nathan Gray
* @package api
* @subpackage framework
* @copyright (c) 2017 Nathan Gray
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
*/
namespace EGroupware\Api;
require_once realpath(__DIR__.'/../loader/common.php'); // autoloader & check_load_extension
use EGroupware\Api\Framework;
use PHPUnit_Framework_TestCase as TestCase;
/**
* Tests for IncludeMgr
*
*/
class IncludeMgrTest extends TestCase
{
public function testEmpty()
{
$mgr = new Framework\IncludeMgr();
$this->assertEmpty($mgr->get_included_files());
}
/**
* Tests by checking api/js/jsapi/egw_config.js, which requires egw_core.js
*/
public function testConfig()
{
$mgr = new Framework\IncludeMgr();
$mgr->include_js_file('/api/js/jsapi/egw_config.js');
$this->assertEquals(
array('/api/js/jsapi/egw_core.js', '/api/js/jsapi/egw_config.js'),
$mgr->get_included_files(true)
);
}
}