mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-21 16:22:20 +02:00
[WIP][POC] the PhpUnit tests can now build and use various environments
drawbacks: the application startup was emulated since it is not compatible with a custom env. when launched with the CLI (it rely on the session in an incompatible way)
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
|
||||
<menus>
|
||||
<menu id="module-test-foo" xsi:type="WebPageMenuNode" _delta="define">
|
||||
<rank>9999</rank>
|
||||
<parent>SystemTools</parent>
|
||||
<url>foo.php</url>
|
||||
<enable_admin_only>1</enable_admin_only>
|
||||
</menu>
|
||||
</menus>
|
||||
</itop_design>
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* Localized data
|
||||
*
|
||||
* @copyright Copyright (C) 2010-2018 Combodo SARL
|
||||
* @license http://opensource.org/licenses/AGPL-3.0
|
||||
*
|
||||
* This file is part of iTop.
|
||||
*
|
||||
* iTop is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* iTop is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Affero General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Affero General Public License
|
||||
* along with iTop. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
Dict::Add('EN US', 'English', 'English', array(
|
||||
|
||||
'module-test-foo-keyword' => 'I am translated',
|
||||
|
||||
));
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
// Copyright (C) 2014-2021 Combodo SARL
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation; version 3 of the License.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program; if not, write to the Free Software
|
||||
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
|
||||
SetupWebPage::AddModule(
|
||||
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
||||
'module-test-foo/0.0.1',
|
||||
array(
|
||||
// Identification
|
||||
//
|
||||
'label' => 'Foo module',
|
||||
'category' => 'Application management',
|
||||
|
||||
// Setup
|
||||
//
|
||||
'dependencies' => array(
|
||||
),
|
||||
'mandatory' => true,
|
||||
'visible' => false,
|
||||
|
||||
// Components
|
||||
//
|
||||
'datamodel' => array(
|
||||
'main.module-test-foo.php',
|
||||
'model.module-test-foo.php',
|
||||
),
|
||||
'webservice' => array(
|
||||
//'webservices.module-test-foo.php',
|
||||
),
|
||||
'dictionary' => array(
|
||||
'en.dict.module-test-foo.php',
|
||||
),
|
||||
'data.struct' => array(
|
||||
//'data.struct.module-test-foo.xml',
|
||||
),
|
||||
'data.sample' => array(
|
||||
//'data.sample.module-test-foo.xml',
|
||||
),
|
||||
|
||||
// Documentation
|
||||
//
|
||||
'doc.manual_setup' => '',
|
||||
'doc.more_information' => '',
|
||||
|
||||
// Default settings
|
||||
//
|
||||
'settings' => array(
|
||||
'module-test-foo' => 'bar',
|
||||
),
|
||||
)
|
||||
);
|
||||
4
test/testUtils/conf/targets/fromProduction/target.ini
Normal file
4
test/testUtils/conf/targets/fromProduction/target.ini
Normal file
@@ -0,0 +1,4 @@
|
||||
[main]
|
||||
compileFrom = 'production'
|
||||
|
||||
#module_path[] = ''
|
||||
16
test/testUtils/conf/targets/noEnvCopy/target.ini
Normal file
16
test/testUtils/conf/targets/noEnvCopy/target.ini
Normal file
@@ -0,0 +1,16 @@
|
||||
[main]
|
||||
compileFrom = ''
|
||||
|
||||
baseConfig = '$APPROOT$/conf/production/config-itop.php'
|
||||
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/authent-local/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-config/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-config-mgmt/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-profiles-itil/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-welcome-itil/'
|
||||
|
||||
module_select[] = 'authent-local'
|
||||
module_select[] = 'itop-config'
|
||||
module_select[] = 'itop-config-mgmt'
|
||||
module_select[] = 'itop-profiles-itil'
|
||||
module_select[] = 'itop-welcome-itil'
|
||||
18
test/testUtils/conf/targets/withDeltaXml/delta.xml
Normal file
18
test/testUtils/conf/targets/withDeltaXml/delta.xml
Normal file
@@ -0,0 +1,18 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.7">
|
||||
<menus>
|
||||
<menu id="withDeltaXml" xsi:type="WebPageMenuNode" _delta="define">
|
||||
<rank>42</rank>
|
||||
<parent>SystemTools</parent>
|
||||
<url>withDeltaXml.php</url>
|
||||
<enable_admin_only>1</enable_admin_only>
|
||||
</menu>
|
||||
</menus>
|
||||
<dictionaries>
|
||||
<dictionnary id="EN US">
|
||||
<entries>
|
||||
<entry id="module-test-foo-keyword" _delta="define">I am translated</entry>
|
||||
</entries>
|
||||
</dictionnary>
|
||||
</dictionaries>
|
||||
</itop_design>
|
||||
15
test/testUtils/conf/targets/withDeltaXml/target.ini
Normal file
15
test/testUtils/conf/targets/withDeltaXml/target.ini
Normal file
@@ -0,0 +1,15 @@
|
||||
[main]
|
||||
compileFrom = ''
|
||||
|
||||
baseConfig = '$APPROOT$/conf/production/config-itop.php'
|
||||
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/'
|
||||
module_path[] = '$APPROOT$/test/testUtils/conf/modules/module-test-foo/'
|
||||
|
||||
module_select[] = 'authent-local'
|
||||
module_select[] = 'itop-config'
|
||||
module_select[] = 'itop-config-mgmt'
|
||||
module_select[] = 'itop-profiles-itil'
|
||||
module_select[] = 'itop-welcome-itil'
|
||||
module_select[] = 'module-test-foo'
|
||||
|
||||
20
test/testUtils/conf/targets/withTestFoo/target.ini
Normal file
20
test/testUtils/conf/targets/withTestFoo/target.ini
Normal file
@@ -0,0 +1,20 @@
|
||||
[main]
|
||||
compileFrom = ''
|
||||
|
||||
baseConfig = '$APPROOT$/conf/production/config-itop.php'
|
||||
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/authent-local/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-config/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-config-mgmt/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-profiles-itil/'
|
||||
module_path[] = '$APPROOT$/datamodels/2.x/itop-welcome-itil/'
|
||||
module_path[] = '$APPROOT$/test/testUtils/conf/modules/module-test-foo/'
|
||||
|
||||
module_select[] = 'authent-local'
|
||||
module_select[] = 'itop-config'
|
||||
module_select[] = 'itop-config-mgmt'
|
||||
module_select[] = 'itop-profiles-itil'
|
||||
module_select[] = 'itop-welcome-itil'
|
||||
module_select[] = 'module-test-foo'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user