function setUp() { parent::setUp(); $this->pluginMeta = new \Arrow\PluginMeta('store-plugin/store-plugin.php'); $this->pluginMeta->defaultOptions = array('foo' => 1, 'bar' => 'two'); $container = new Container(); $container->object('pluginMeta', $this->pluginMeta)->factory('store', 'Arrow\\Options\\Store'); $this->container = $container; $this->store = $container->lookup('store'); }
function test_it_can_encase_application_with_lazy_dependencies() { $container = new Container(); $container->object('api_key', 'foobar'); $container->factory('app', function ($container) { return 'Encase\\Application'; }); $container->object('remote_service', function ($container) { return new RemoteService(); }); $app = $container->lookup('app'); $this->assertInstanceOf('Encase\\RemoteService', $app->remote_service); $this->assertEquals('foobar', $app->api_key); }