/** * Puts a list of tokens into the dependency cache. * * @param array The list of new tokens. * @param AgaviVirtualArrayPath The base path to which all tokens are * appended. * * @author Uwe Mesecke <*****@*****.**> * @since 0.11.0 */ public function addDependTokens(array $tokens, AgaviVirtualArrayPath $base) { foreach ($tokens as $token) { $base->setValueByChildPath($token, $this->depData, true); } }
public function testSetValueByChildPath() { $array = array("path" => array("jump" => array("sip" => "whatever"))); $default = array('more' => 'less'); $path = 'sip'; $value = 'sup'; $obj = new AgaviVirtualArrayPath("path[jump]"); $obj->setValueByChildPath($path, $array, $value); $this->assertEquals(array('sip' => 'sup'), $obj->getValue($array)); }