public function testCall() { jClasses::inc('jelix_tests~testCache'); $myClass = new testCache(); $returnData = jCache::call(array('testCache', 'staticMethod'), array(1, 2), 0, $this->profile); $this->assertTrue($returnData == 3); $dataCached = jCache::get(md5(serialize(array('testCache', 'staticMethod')) . serialize(array(1, 2))), $this->profile); $this->assertTrue($dataCached == $returnData); try { jCache::call(array('testCache', 'missingStaticMethod'), null, 0, $this->profile); $this->fail(); } catch (jException $e) { $this->pass(); } $returnData = jCache::call(array($myClass, 'method'), array(1, 2), 0, $this->profile); $this->assertTrue($returnData == 3); $dataCached = jCache::get(md5(serialize(array($myClass, 'method')) . serialize(array(1, 2))), $this->profile); $this->assertTrue($dataCached == $returnData); try { jCache::call(array($myClass, 'missingMethod'), null, 0, $this->profile); $this->fail(); } catch (jException $e) { $this->pass(); } $returnData = jCache::call('testFunction', array(1, 2), 0, $this->profile); $this->assertTrue($returnData == 3); $dataCached = jCache::get(md5(serialize('testFunction') . serialize(array(1, 2))), $this->profile); $this->assertTrue($dataCached == $returnData); try { jCache::call('testFunction_missing', null, 0, $this->profile); $this->fail(); } catch (jException $e) { $this->pass(); } }