mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-22 14:41:29 +01:00
W.I.P. Some more Etemplate testing stuff
This commit is contained in:
parent
25b4c534a4
commit
ee62801ace
31
api/src/Etemplate/Widget/test/TemplateTest.php
Normal file
31
api/src/Etemplate/Widget/test/TemplateTest.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* App
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author Nathan Gray
|
||||||
|
* @package
|
||||||
|
* @copyright (c) 2017 Nathan Gray
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace EGroupware\Api\Etemplate\Widget;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description of TemplateTest
|
||||||
|
*
|
||||||
|
* @author nathan
|
||||||
|
*/
|
||||||
|
class TemplateTest extends WidgetBaseTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test instanciation of a template
|
||||||
|
*/
|
||||||
|
public function testInstance()
|
||||||
|
{
|
||||||
|
$this->markTestIncomplete(
|
||||||
|
'This test has not been implemented yet.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
26
api/src/Etemplate/test/WidgetBaseTest.php
Normal file
26
api/src/Etemplate/test/WidgetBaseTest.php
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base test file for all widget tests
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author Nathan Gray
|
||||||
|
* @package api
|
||||||
|
* @copyright (c) 2017 Nathan Gray
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace EGroupware\Api\Etemplate;
|
||||||
|
|
||||||
|
// test base providing Egw environment, since we need the DB
|
||||||
|
require_once realpath(__DIR__.'/../../test/LoggedInTest.php');
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Base class for all widget tests
|
||||||
|
*
|
||||||
|
* Widget scans the apps for widgets, which needs the app list, pulled from the
|
||||||
|
* database, so we need to log in.
|
||||||
|
*/
|
||||||
|
class WidgetBaseTest extends \EGroupware\Api\LoggedInTest {
|
||||||
|
//put your code here
|
||||||
|
}
|
75
api/src/test/EtemplateTest.php
Normal file
75
api/src/test/EtemplateTest.php
Normal file
@ -0,0 +1,75 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test Etemplate main file
|
||||||
|
*
|
||||||
|
* @link http://www.egroupware.org
|
||||||
|
* @author Nathan Gray
|
||||||
|
* @package api
|
||||||
|
* @copyright (c) 2017 Nathan Gray
|
||||||
|
* @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace EGroupware\Api;
|
||||||
|
|
||||||
|
use EGroupware\Api;
|
||||||
|
use PHPUnit_Framework_TestCase as TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test the main class of Etemplate
|
||||||
|
*
|
||||||
|
* Etemplate Widget base classscans the apps for widgets, which needs the app
|
||||||
|
* list, pulled from the database, so we need to log in.
|
||||||
|
*/
|
||||||
|
class EtemplateTest extends \EGroupware\Api\LoggedInTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test reading xml files
|
||||||
|
*
|
||||||
|
* This really just tests that the files can be found. Testing the parsing
|
||||||
|
* is done in the Template test.
|
||||||
|
*/
|
||||||
|
public function testRead()
|
||||||
|
{
|
||||||
|
$etemplate = new Etemplate();
|
||||||
|
|
||||||
|
// Test missing template fails
|
||||||
|
$this->assertEquals(false, $etemplate->read('totally invalid'), 'Reading invalid template');
|
||||||
|
|
||||||
|
// Templates must be in the correct templates directory - use one from API
|
||||||
|
$this->assertEquals(true, $etemplate->read('api.prompt'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testSetDOMId()
|
||||||
|
{
|
||||||
|
|
||||||
|
$etemplate = new Etemplate();
|
||||||
|
/*
|
||||||
|
Etemplate::$response = $this->getMockBuilder(Etemplate\Api\Json\Response)
|
||||||
|
->disableOriginalConstructor()
|
||||||
|
->setMethods(['generic'])
|
||||||
|
->getMock($etemplate);
|
||||||
|
Etemplate::$response->expects($this->once())
|
||||||
|
->method('generic');
|
||||||
|
*/
|
||||||
|
$etemplate->set_dom_id('test_id');
|
||||||
|
|
||||||
|
$this->markTestIncomplete(
|
||||||
|
'This test has not been implemented yet.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testArrayMerge()
|
||||||
|
{
|
||||||
|
$this->markTestIncomplete(
|
||||||
|
'This test has not been implemented yet.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testExec()
|
||||||
|
{
|
||||||
|
$this->markTestIncomplete(
|
||||||
|
'This test has not been implemented yet.'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user