Project

General

Profile

Actions

Bug #63943

closed

PHPUnit-Tests fail on Windows

Added by Stephan Großberndt over 9 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
-
Target version:
-
Start date:
2014-12-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
7
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Executing the PHPUnit-Tests on Windows is not possible currently:

Fatal error: Cannot redeclare class TYPO3\CMS\Extbase\Tests\Unit\DomainObject\DomainObject_5490aef9162dd in D:\typo3\master\typo3\sysext\extbase\Tests\Unit\DomainObject\AbstractEntityTest.php(89) : eval()'d code on line 4

This is due to

        $domainObjectName = uniqid('DomainObject_');
        $domainObjectNameWithNS = __NAMESPACE__ . '\\' . $domainObjectName;
        eval('namespace ' . __NAMESPACE__ . '; class ' . $domainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
            public $foo;
            public $bar;
        }');
        $secondDomainObjectName = uniqid('DomainObject_');
        $secondDomainObjectNameWithNS = __NAMESPACE__ . '\\' . $secondDomainObjectName;
        eval('namespace ' . __NAMESPACE__ . '; class ' . $secondDomainObjectName . ' extends \\' . \TYPO3\CMS\Extbase\DomainObject\AbstractEntity::class . ' {
            public $foo;
            public $bar;
        }');

On windows the calls

        $domainObjectName = uniqid('DomainObject_');
        $secondDomainObjectName = uniqid('DomainObject_');

return the same id, which is related to #59701, #58602 and #59055.

Using

        $domainObjectName = 'DomainObject_' . md5(uniqid(microtime(), true));

solves the issue.


Related issues 6 (0 open6 closed)

Related to TYPO3 Core - Bug #59701: uniqid() not returning unique valuesClosedTymoteusz Motylewski2014-06-20

Actions
Related to TYPO3 Core - Bug #58602: Datepicker issue on multiple datetime fields in BEClosed2014-05-07

Actions
Related to TYPO3 Core - Bug #59055: Import from .t3d failed on Windows 7 with a lot of messagesClosedMarc Bastian Heinrichs

Actions
Related to TYPO3 Core - Bug #64055: PHPUnit-Tests fail on Windows (2)Closed2014-12-29

Actions
Related to TYPO3 Core - Task #69050: Supply a Utility method to create unique ids in the coreClosedNicole Cordes2015-08-14

Actions
Related to TYPO3 Core - Bug #69039: Functional Tests: NEWid generation in tests does not match coreClosedMorton Jonuschat2015-08-14

Actions
Actions

Also available in: Atom PDF