Extends
lithium\test\Unit
Tests reading from all configured stores with fallbacks.
Returns
voidSource
public function testWriteReadMergeAllConfigurations() {
Catalog::reset();
Catalog::config(array(
'runtime0' => array('adapter' => new Memory()),
'runtime1' => array('adapter' => new Memory())
));
$data = '/postalCode en0/';
Catalog::write('runtime0', 'validation.postalCode', 'en', $data);
$data = '/postalCode en_US1/';
Catalog::write('runtime1', 'validation.postalCode', 'en_US', $data);
$data = '/postalCode en1/';
Catalog::write('runtime1', 'validation.postalCode', 'en', $data);
$result = Catalog::read(true, 'validation.postalCode', 'en_US');
$expected = '/postalCode en_US1/';
$this->assertEqual($expected, $result);
Catalog::reset();
Catalog::config(array(
'runtime0' => array('adapter' => new Memory()),
'runtime1' => array('adapter' => new Memory())
));
$data = array(
'GRD' => 'de0 Griechische Drachme',
'DKK' => 'de0 Dänische Krone'
);
Catalog::write('runtime0', 'currency', 'de', $data);
$data = array(
'GRD' => 'de1 Griechische Drachme'
);
Catalog::write('runtime1', 'currency', 'de', $data);
$data = array(
'GRD' => 'de_CH1 Griechische Drachme'
);
Catalog::write('runtime1', 'currency', 'de_CH', $data);
$result = Catalog::read(true, 'currency', 'de_CH');
$expected = array(
'GRD' => 'de_CH1 Griechische Drachme',
'DKK' => 'de0 Dänische Krone'
);
$this->assertEqual($expected, $result);
}