Molkobain
32297d93dd
N°5655 - Add utils::ToSnakeCase() method
2022-12-13 11:47:32 +01:00
Molkobain
dcdce52608
N°5655 - Add new sanitization filters for routing
...
* utils::ENUM_SANITIZATION_FILTER_OPERATION filter to enable operation "namespaces" in current operations for better reading
* utils::ENUM_SANITIZATION_FILTER_ROUTE filter for upcoming auto routing
2022-11-15 08:42:26 +01:00
Pierre Goiffon
f0d1c3ac60
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
...
# Conflicts:
# application/utils.inc.php
# core/htmlsanitizer.class.inc.php
# datamodels/2.x/itop-portal-base/portal/src/Twig/AppExtension.php
# pages/UI.php
# test/OQL/DataLocalizerTest.php
# test/OQL/OQLToSQLAllClassesTest.php
# test/OQL/OQLToSQLGroupByTest.php
# test/OQL/OQLToSQLNestedSelectTest.php
# test/OQL/OQLToSQLTest.php
# test/application/UtilsTest.php
2022-05-24 11:13:28 +02:00
Pierre Goiffon
f57d1f1de3
✅ Fix PHPunit errors with InlineImageMock.php and UtilsTest
...
HTMLDOMSanitizerTest : fix "Fatal error: Cannot declare class InlineImage, because the name is already in use in /var/www/html/iTop/test/core/sanitizer/InlineImageMock.php"
We are now injecting the class to mock, instead of declaring another class with the same name (was working before but why ?!???)
\UtilsTest::testSanitizer : no more testing the "class" filter, because it is a simple indirection, and we need to load datamodel which is causing multiple problems (see the comment in the test method dataprovider)
2022-05-20 10:48:05 +02:00
Benjamin Dalsass
03ef4246bf
N°4899 - add sanitizer url since annotation and tests for sanitizer function
2022-05-18 12:03:07 +02:00
Molkobain
ff58fb8617
N°5172 - Add internal helpers to keep usage of null value in native PHP methods: strlen() => utils::StrLen()
2022-05-16 16:15:18 +02:00
Pierre Goiffon
f4a027b474
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
...
# Conflicts:
# composer.json
# core/cmdbchangeop.class.inc.php
# core/cmdbobject.class.inc.php
# css/light-grey.scss
# setup/setuputils.class.inc.php
# test/ItopTestCase.php
# test/core/ConfigTest.php
# test/core/LogAPITest.php
# test/core/UserRightsTest.php
# test/core/dictApcuTest.php
# test/core/dictTest.php
# test/core/iTopConfigParserTest.php
# test/core/ormLinkSetTest.php
# test/phpunit.xml.dist
# test/postbuild_integration.xml.dist
# test/setup/SetupUtilsTest.php
# test/status/StatusIncTest.php
# webservices/cron.php
2022-04-22 15:26:18 +02:00
Pierre Goiffon
ec143c43db
N°3091 Update PHPUnit to 8.5 : fix setUp and teardDown methods signatures
...
"Return type declaration must be compatible with parent"
See https://phpunit.de/announcements/phpunit-8.html "Return Type of Template Methods"
2022-04-21 12:02:35 +02:00
Molkobain
cd7f9e478f
N°4913 - Avoid object initials to overflow in medallions
2022-03-06 22:44:12 +01:00
Molkobain
e3586cff65
Unit tests: Add unit cyrillic alphabet test case for utils::ToAcronym()
2022-03-06 16:31:48 +01:00
Pierre Goiffon
8578d18e7f
Merge remote-tracking branch 'origin/support/2.7' into support/3.0
...
# Conflicts:
# core/cmdbsource.class.inc.php
# core/config.class.inc.php
# core/displayablegraph.class.inc.php
# core/log.class.inc.php
# datamodels/2.x/itop-config-mgmt/dictionaries/tr.dict.itop-config-mgmt.php
# datamodels/2.x/itop-knownerror-mgmt/dictionaries/tr.dict.itop-knownerror-mgmt.php
# datamodels/2.x/itop-service-mgmt/dictionaries/tr.dict.itop-service-mgmt.php
# datamodels/2.x/itop-tickets/tr.dict.itop-tickets.php
# datamodels/2.x/itop-welcome-itil/tr.dict.itop-welcome-itil.php
# dictionaries/tr.dictionary.itop.core.php
# dictionaries/tr.dictionary.itop.ui.php
# pages/UI.php
# setup/itopdesignformat.class.inc.php
# test/core/LogAPITest.php
# test/integration/iTopModulesPhpVersionChecklistTest.php
# test/postbuild_integration/SetupCssIntegrityChecklistTest.php
# test/postbuild_integration/iTopModuleXmlInstallationChecklistTest.php
# test/status/StatusTest.php
2022-01-10 16:15:00 +01:00
Pierre Goiffon
ddb8378fe6
N°4624 align phpunit annotations
...
Remove processIsolation when not needed
When needed, make sure to have also their counterpart (preserveGlobalState and backupGlobals)
2022-01-07 15:20:34 +01:00
Pierre Goiffon
bd67b71f3d
Merge remote-tracking branch 'origin/support/2.7' into develop
2021-07-06 11:36:34 +02:00
Pierre Goiffon
e32e275f40
🎨 Align dataprovider elements
2021-06-29 16:45:34 +02:00
Pierre Goiffon
aa9ab1ace5
Merge remote-tracking branch 'origin/support/2.7' into develop
...
# Conflicts:
# css/css-variables.scss
# datamodels/2.x/authent-cas/module.authent-cas.php
# datamodels/2.x/authent-external/module.authent-external.php
# datamodels/2.x/authent-ldap/module.authent-ldap.php
# datamodels/2.x/authent-local/module.authent-local.php
# datamodels/2.x/combodo-db-tools/module.combodo-db-tools.php
# datamodels/2.x/itop-attachments/module.itop-attachments.php
# datamodels/2.x/itop-backup/module.itop-backup.php
# datamodels/2.x/itop-bridge-virtualization-storage/module.itop-bridge-virtualization-storage.php
# datamodels/2.x/itop-change-mgmt-itil/module.itop-change-mgmt-itil.php
# datamodels/2.x/itop-change-mgmt/module.itop-change-mgmt.php
# datamodels/2.x/itop-config-mgmt/module.itop-config-mgmt.php
# datamodels/2.x/itop-config/module.itop-config.php
# datamodels/2.x/itop-core-update/module.itop-core-update.php
# datamodels/2.x/itop-datacenter-mgmt/module.itop-datacenter-mgmt.php
# datamodels/2.x/itop-endusers-devices/module.itop-endusers-devices.php
# datamodels/2.x/itop-files-information/module.itop-files-information.php
# datamodels/2.x/itop-full-itil/module.itop-full-itil.php
# datamodels/2.x/itop-hub-connector/module.itop-hub-connector.php
# datamodels/2.x/itop-incident-mgmt-itil/module.itop-incident-mgmt-itil.php
# datamodels/2.x/itop-knownerror-mgmt/module.itop-knownerror-mgmt.php
# datamodels/2.x/itop-portal-base/module.itop-portal-base.php
# datamodels/2.x/itop-portal/module.itop-portal.php
# datamodels/2.x/itop-problem-mgmt/module.itop-problem-mgmt.php
# datamodels/2.x/itop-profiles-itil/module.itop-profiles-itil.php
# datamodels/2.x/itop-request-mgmt-itil/module.itop-request-mgmt-itil.php
# datamodels/2.x/itop-request-mgmt/module.itop-request-mgmt.php
# datamodels/2.x/itop-service-mgmt-provider/module.itop-service-mgmt-provider.php
# datamodels/2.x/itop-service-mgmt/module.itop-service-mgmt.php
# datamodels/2.x/itop-sla-computation/module.itop-sla-computation.php
# datamodels/2.x/itop-storage-mgmt/module.itop-storage-mgmt.php
# datamodels/2.x/itop-tickets/module.itop-tickets.php
# datamodels/2.x/itop-virtualization-mgmt/module.itop-virtualization-mgmt.php
# datamodels/2.x/itop-welcome-itil/module.itop-welcome-itil.php
# datamodels/2.x/version.xml
2021-06-29 16:12:49 +02:00
Pierre Goiffon
b5074c4cee
N°3806 Fix saying memory_limit isn't enough in CLI scripts and setup
...
This was caused by the strict comparison in \utils::IsMemoryLimitOk for the special "-1" value of memory_limit, which was added in c2f5cafa .
Fix was to change \utils::ConvertToBytes : it was returning original value when input was numeric (so if input is '-1' output was '-1') now it always returns an int (input '-1' output -1)
2021-06-28 14:53:39 +02:00
Pierre Goiffon
d8e2a1cc7c
Merge branch 'support/2.7' into develop
...
# Conflicts:
# README.md
# composer.json
# composer.lock
# core/cmdbsource.class.inc.php
# core/dbobject.class.php
# datamodels/2.x/combodo-db-tools/db_analyzer.class.inc.php
# datamodels/2.x/combodo-db-tools/dbtools.php
# datamodels/2.x/combodo-db-tools/dictionaries/zh_cn.dict.combodo-db-tools.php
# datamodels/2.x/itop-attachments/dictionaries/zh_cn.dict.itop-attachments.php
# datamodels/2.x/itop-core-update/dictionaries/zh_cn.dict.itop-core-update.php
# dictionaries/zh_cn.dictionary.itop.core.php
# dictionaries/zh_cn.dictionary.itop.ui.php
# lib/composer/InstalledVersions.php
# lib/composer/autoload_classmap.php
# lib/composer/autoload_static.php
# lib/composer/installed.php
# lib/composer/platform_check.php
# pages/ajax.render.php
# pages/csvimport.php
# setup/ajax.dataloader.php
# setup/index.php
# setup/setuputils.class.inc.php
# test/application/UtilsTest.php
2021-06-14 16:19:56 +02:00
Pierre Goiffon
44952d1ea0
✅ Fix \UtilsTest::testIsMemoryLimit
2021-05-25 17:04:32 +02:00
BGdu38
c2f5cafaf3
Avoid setting memory_limit to lower value than the one already configured ( #215 )
...
Some scripts are setting the memory_limit PHP option : setup, csvimport and XLSX export. This was done to avoid crashing when dealing with such large amount of data.
But sometimes we were setting the value without any prior check, so we could actually lower the memory_limit value :/
Now this memory_limit change is done using \utils::SetMinMemoryLimit, which will call ini_set if and only if the current value is lower than the one to be set.
Setup calls (setup/ajax.dataloader.php and webservices/backoffice.dataloader.php) were left as is as they weren't subject to this bug, and also they are more complex (logging done on each case).
2021-05-25 12:03:19 +02:00
Molkobain
7aecdd0dc7
N°2875 - Extract method to find mentioned objects into utils so it can used by extensions, not only the trigger
2021-04-23 17:01:17 +02:00
Molkobain
8b25679df8
Extract function to get a person's initials to a dedicated ToAcronym function in \utils
2021-04-05 21:05:46 +02:00
odain
8fce088e6f
Merge branch 'support/2.7' into develop
2021-03-17 15:26:19 +01:00
bruno-ds
91fc2d2e2b
N°3671 - reformat tests
2021-03-17 08:46:41 +01:00
odain
b5adb2e82b
N°3671: fix and make test more lisible
2021-03-15 19:01:09 +01:00
odain
eacdfa4088
Merge branch 'support/2.7' into develop
2021-03-15 16:06:20 +01:00
odain
386c90c601
N°3668 - URL direct error: renamed trust_proxies<-behind_reverse_proxy
2021-03-15 14:56:16 +01:00
odain
3bcae734e5
N°3671 : persist absolute URL when setup context (force trustproxy enabled)
2021-03-15 12:27:05 +01:00
odain
577ae34b50
Merge branch 'support/2.7' into develop
2021-03-09 15:40:30 +01:00
bruno-ds
ae6a264d6d
N°3671 - fix typo in HTTP header name
2021-03-05 16:57:03 +01:00
bruno-ds
7b093a6bba
N°3671 - app_root_url: handle reverse proxies during the setup and preserve existing configuration during an upgrade.
2021-03-03 11:55:18 +01:00
bruno-ds
dd921e49b6
rollback unit test since the root cause was elsewhere
2021-01-25 10:44:14 +01:00
bruno-ds
71d3713950
N°3651 - add a (commented out) test to prove the bug
...
just uncomment to use the test.
2021-01-15 11:14:36 +01:00
Molkobain
c5b8d3fa72
Merge remote-tracking branch 'origin/develop' into feature/backoffice-full-moon-design
...
# Conflicts:
# application/datamodel.application.xml
# application/itopwebpage.class.inc.php
# css/light-grey.scss
2020-08-19 10:20:37 +02:00
odain
8902d6e532
CI migration/automation + new test to ease iTop release management
...
- new Jenkinsfile and .jenkins removal to launch phpunit/behat tests
triggered on both iTop build and push.
- N°3053 - Check XML conversion methods
- N°3057 - New build recipe
- N°3059 - Automatically set the documentation URLs
- N°3052 - Check community modules XML version against latest version
- N°3054 - Check community modules version against major version
- N°3062 - setup.css file integrity test
- N°3060 - Check consistency between the list of modules and installation.xml
- Add exclusion group for CI
- N°3061 - Automatically check the installation.xml consistency
2020-08-07 14:48:51 +02:00
Molkobain
d6ab310d24
N°3233 - Fix unit test and autoloader due to folders renaming in /sources
2020-08-04 13:26:58 +02:00
Eric
9d8a7bf561
N°3007 - Warn the user that installing a patch on a non conform install is not recommended
2020-06-04 10:38:58 +02:00
Pierre Goiffon
13d31ac211
utils::GetDefaultUrlAppRoot : make comparison case insentitive, add a test
2019-12-23 11:06:29 +01:00
Pierre Goiffon
06791b06c4
Fix utils::EndsWith when needle bigger that value
2019-11-21 11:57:24 +01:00
Pierre Goiffon
0d0f8e9ffc
💚 N°2538 Fix test
...
Was broken since ce207e5c
2019-10-17 10:45:12 +02:00
Eric
fbc5280add
💚 Fix unit tests
2019-10-17 09:23:32 +02:00
Pierre Goiffon
f65f22f333
N°2538 check path validity little improvements
...
* ajax-backup : change code to be more readable
* does a realpath() call on basepath to avoid troubles when havin '/' on Windows
2019-10-16 11:37:50 +02:00
Pierre Goiffon
607d355c61
N°2538 enforce generic method to check path validity
...
Now uses realpath() and StartsWith
2019-10-16 11:13:19 +02:00
Pierre Goiffon
29c30c1f89
🎨 Code format
2019-10-16 11:13:19 +02:00
Dennis Lassiter
49bb8fd515
Fixed bug that caused memory_limit=-1 to lead to 'not enough memory' … ( #1 )
...
* Fixed bug that caused memory_limit=-1 to lead to 'not enough memory' error
* Added Unit Test to Memory Limit Check
2018-09-06 10:04:28 +02:00