I have the following base lass for controller tests:
public function createApplication() {
include __DIR__ . '../web/index_dev.php';
$app['debug'] = true;
$app['session.test'] = true;
$app['helper'] = function ($app) {
return new TestHelper($app);
}; // fails!!
return $app;
}
public function setUp() {
parent::setUp();
$this->client = parent::createClient();
}
At Silex 1.3 it worked fine, but after upgrade for v2 it fails at marked line. Once I comment it - everything is fine.
UPD#1: I figured out why it fails: Cannot override frozen service "helper".
I understand the meaning of error, but can't understand how to fix it. It isa test case, so I need to replace it with mock/test implementation of object, but can't..