Merge remote-tracking branch 'origin/support/2.7' into support/3.0

# Conflicts:
#	application/cmdbabstract.class.inc.php
#	application/utils.inc.php
#	core/coreexception.class.inc.php
#	core/userrights.class.inc.php
#	datamodels/2.x/itop-portal-base/portal/src/Form/ObjectFormManager.php
#	tests/php-unit-tests/README.md
#	tests/php-unit-tests/unitary-tests/core/DBObjectTest.php
This commit is contained in:
Pierre Goiffon
2023-11-15 11:44:59 +01:00
23 changed files with 573 additions and 147 deletions

View File

@@ -59,6 +59,16 @@ Fix that in the XML configuration in the PHP section
<ini name="memory_limit" value="512M"/>
```
### Measure the time spent in a test
Simply cut'n paste the following line at several places within the test function:
```php
if (isset($fStarted)) {echo 'L'.__LINE__.': '.round(microtime(true) - $fStarted, 3)."\n";} $fStarted = microtime(true);
```
### Understand tests interactions
With PHPStorm, select two tests, right click to get the context menu, then `run`.
@@ -119,4 +129,3 @@ This won't work because the comment MUST start with `/**` (two stars) to be cons
Therefore, if the tests are isolated, then `setupBeforeClass` will be called as often as `setUp`.
This has been proven with [`runClassInSeparateProcessTest.php`](experiments/runClassInSeparateProcessTest.php)