File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,12 @@ abstract class AbstractHelper
2424 *
2525 * @param \IC\Bundle\Base\TestBundle\Test\Functional\WebTestCase $testCase
2626 */
27- public function __construct (WebTestCase $ testCase )
27+ public function __construct (WebTestCase $ testCase = null )
28+ {
29+ $ this ->testCase = $ testCase ;
30+ }
31+
32+ public function setTestCase (WebTestCase $ testCase )
2833 {
2934 $ this ->testCase = $ testCase ;
3035 }
Original file line number Diff line number Diff line change @@ -75,7 +75,18 @@ public function getHelper($name)
7575 {
7676 $ helperClass = $ this ->helperList ->get ($ name );
7777
78- return new $ helperClass ($ this );
78+ if ($ helperClass ) {
79+ return new $ helperClass ($ this );
80+ }
81+
82+ $ container = $ this ->getClient ()->getContainer ();
83+ $ helperService = $ container ->get ($ name );
84+
85+ if ($ helperService ) {
86+ $ helperService ->setTestCase ($ this );
87+
88+ return $ helperService ;
89+ }
7990 }
8091
8192 /**
You can’t perform that action at this time.
0 commit comments