Skip to content

Commit 95487c1

Browse files
author
Danilo
committed
Support dynamically registered helpers
1 parent 897acc2 commit 95487c1

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

Test/WebTestCase.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff 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
/**

0 commit comments

Comments
 (0)