mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 06:30:59 +01:00
Move IncludeMgr tests into their own test class,
originals left there since they look useful.
This commit is contained in:
parent
74af635dac
commit
b2ec0e9aa6
45
api/src/test/IncludeMgrTest.php
Normal file
45
api/src/test/IncludeMgrTest.php
Normal 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)
|
||||
);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user