Bug #1638

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

Added by Malte Jansen over 13 years ago. Updated about 11 years ago.

Status:
Resolved
Priority:
Should have
Target version:
-
Start date:
2008-10-02
Due date:
% Done:

0%

Estimated time:

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.

#1

Updated by Karsten Dambekalns over 13 years ago

  • Status changed from New to Resolved
  • Assignee 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