shouldReceive('get')->with('database.cache_store', null)->andReturn(null); $cache->shouldReceive('store')->with(null)->andReturn($store); $db = Db::__make($event, $config, $log, $cache); $config->shouldReceive('get')->with('database.foo', null)->andReturn('foo'); $this->assertEquals('foo', $db->getConfig('foo')); $config->shouldReceive('get')->with('database', [])->andReturn([]); $this->assertEquals([], $db->getConfig()); $callback = function () { }; $event->shouldReceive('listen')->with('db.some', $callback); $db->event('some', $callback); $event->shouldReceive('trigger')->with('db.some', null, false); $db->trigger('some'); } }