1 | <?php |
||
22 | class InstallContext implements Context |
||
23 | { |
||
24 | use CommonContextTrait; |
||
25 | |||
26 | static private $configFile; |
||
27 | |||
28 | static private $yawikGlobalConfig; |
||
29 | |||
30 | static private $yawikBackupConfig; |
||
31 | |||
32 | public function __construct() |
||
38 | |||
39 | /** |
||
40 | * @Given I have install module activated |
||
41 | */ |
||
42 | public function iHaveInstallModuleActivated() |
||
59 | |||
60 | /** |
||
61 | * @Given I go to the install page |
||
62 | */ |
||
63 | public function iGoToInstallPage() |
||
68 | |||
69 | /** |
||
70 | * @AfterSuite |
||
71 | */ |
||
72 | static public function tearDown() |
||
76 | |||
77 | /** |
||
78 | * @AfterScenario |
||
79 | */ |
||
80 | public function afterScenario() |
||
84 | |||
85 | /** |
||
86 | * @BeforeSuite |
||
87 | */ |
||
88 | static public function setUp() |
||
92 | |||
93 | static public function restoreConfig() |
||
107 | |||
108 | /** |
||
109 | * @Given I fill database connection with an active connection |
||
110 | */ |
||
111 | public function iFillActiveConnectionString() |
||
117 | } |
||
118 |
Let’s assume you have a class which uses late-static binding:
The code above will run fine in your PHP runtime. However, if you now create a sub-class and call the
getSomeVariable()
on that sub-class, you will receive a runtime error:In the case above, it makes sense to update
SomeClass
to useself
instead: