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.

Should have
Target version:
Start date:
Due date:
% Done:


Estimated time:



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->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.


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