public function testSet() { $this->container->expects($this->once())->method('has')->will($this->returnValue(true)); $this->container->expects($this->once())->method('get')->will($this->returnValue(10)); $this->container->expects($this->once())->method('set')->with($this->equalTo('Foo.bar'), $this->equalTo(10)); $this->blobStore->expects($this->once())->method('save'); $instance = new TransientStatsdCollector($this->blobStore, 42); $instance->set('Foo.bar', 10); $instance->saveStats(); }
private function initStats($date) { $this->transientStatsdCollector->shouldRecord($this->isEnabled()); $this->transientStatsdCollector->init('misses', 0); $this->transientStatsdCollector->init('deletes', 0); $this->transientStatsdCollector->init('hits', array()); $this->transientStatsdCollector->init('medianRetrievalResponseTime', array()); $this->transientStatsdCollector->init('noCache', array()); $this->transientStatsdCollector->set('meta.version', self::VERSION); $this->transientStatsdCollector->set('meta.cacheLifetime.embedded', $GLOBALS['smwgQueryResultCacheLifetime']); $this->transientStatsdCollector->set('meta.cacheLifetime.nonEmbedded', $GLOBALS['smwgQueryResultNonEmbeddedCacheLifetime']); $this->transientStatsdCollector->init('meta.collectionDate.start', $date); $this->transientStatsdCollector->set('meta.collectionDate.update', $date); }