public function testBundle()
{
$config = new Bundle('DummyBundle', $this->getJarves());
$events = [['key' => 'core/object/modify', 'desc' => 'foo'], ['key' => 'core/object/update', 'desc' => 'bar']];
foreach ($events as $item) {
$items[] = new Event($item, $this->getJarves());
}
$config->setEvents($items);
$config->setBundleName('FooBar');
$caches = [new BundleCache(['key' => 'foo', 'method' => 'bar'], $this->getJarves()), new BundleCache(['key' => 'foo2'], $this->getJarves())];
$config->setCaches($caches);
$array = array('name' => 'FooBar', 'class' => 'Jarves\\Configuration\\Bundle', 'caches' => array(array('key' => 'foo', 'method' => 'bar'), array('key' => 'foo2')), 'events' => array(array('key' => 'core/object/modify', 'desc' => 'foo'), array('key' => 'core/object/update', 'desc' => 'bar')));
$xml = '<bundle>
<caches>
<cache method="bar">foo</cache>
<cache>foo2</cache>
</caches>
<events>
<event key="core/object/modify">
<desc>foo</desc>
</event>
<event key="core/object/update">
<desc>bar</desc>
</event>
</events>
</bundle>';
$this->assertEquals($array, $config->toArray());
$this->assertEquals($xml, $config->toXml());
}