TYPO3 Flow Base DistributionPackagesApplications

Bug #1638

Static is not suppose to work in the way it's used in F3_Testing_Model_TestRunner.php

Added by Malte Jansen almost 7 years ago. Updated almost 5 years ago.

Status:Resolved Start date:2008-10-02
Priority:Should have Due date:
Assigned To:Karsten Dambekalns % Done:

0%

Category:-
Target version:-

Description

File:
http://forge.typo3.org/repositories/entry/package-testing/trunk/Classes/Model/F3_Testing_Model_TestRunner.php

The following variable is defined as static, so you cannot change the content afterwards in the constructor. Especially not with an other object. (See http://de.php.net/manual/en/language.oop5.static.php#85277)

public static $componentManager;

    public function __construct(F3::Testing::Model::TestCaseRepository $testCaseRepository, F3::Testing::Model::TestListener $testListener) {
        ...
        self::$componentManager = $FLOW3->getComponentManager();

        self::$componentManager->unregisterComponent('F3::FLOW3::Session::SessionInterface');
        self::$componentManager->registerComponent('F3::FLOW3::Session::SessionInterface', 'F3::FLOW3::Session::Transient');
        ...
    }

So the apache might cause crash on some plattforms with the Testing. I have located the crashing on windows with php5.3alpha2 to this constructor. If it's not called, the Testing does not crash.

History

#1 Updated by Karsten Dambekalns almost 7 years ago

  • Status changed from New to Resolved
  • Assigned To set to Karsten Dambekalns

The comment you refer to above explains that one has to use self::$var and not self::var - but the code uses self::$componentManager. This is correct use. And static means you can use a variable without having an instance of it's parent class. It doesn't make it immutable.

I suspect alpha2 to be rather unstable, it crashed on my machine with a bus error doing anything, so...

Also available in: Atom PDF