public function testCaching() { $data = array('catalog' => 'Katalog'); Catalog::write('runtime', 'message', 'de', $data, array('scope' => 'foo')); $this->assertFalse(Message::cache()); $result = Message::translate('catalog', array('locale' => 'de', 'scope' => 'foo')); $this->assertEqual('Katalog', $result); $cache = Message::cache(); $this->assertEqual('Katalog', $cache['foo']['de']['catalog']); Message::cache(false); $this->assertFalse(Message::cache()); Message::cache(array('foo' => array('de' => array('catalog' => '<Katalog>')))); $result = Message::translate('catalog', array('locale' => 'de', 'scope' => 'foo')); $this->assertEqual('<Katalog>', $result); $options = array('locale' => 'de', 'scope' => 'foo', 'count' => 2); $this->assertEqual('<Katalog>', Message::translate('catalog', $options)); Message::cache(false); Message::cache(array('foo' => array('de' => array('catalog' => array('<Katalog>'))))); $this->assertNull(Message::translate('catalog', $options)); }