Bug #63943

PHPUnit-Tests fail on Windows

Added by Stephan Großberndt almost 7 years ago. Updated almost 3 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

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
#1

Updated by Gerrit Code Review almost 7 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35528

#2

Updated by Gerrit Code Review almost 7 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/35529

#3

Updated by Stephan Großberndt almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#4

Updated by Benni Mack almost 3 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF