public function testProfile() { $collectorStub = $this->getMock('Itkg\\Profiler\\DataCollector\\CacheDataCollector'); $storageStub = $this->getMock('Itkg\\Profiler\\Storage\\FileStorage', array(), array('data')); $profiler = new Profiler($storageStub); $profiler->addCollector($collectorStub); $collectorStub->expects($this->once())->method('collect'); $storageStub->expects($this->once())->method('save'); $profiler->profile(Request::createFromGlobals()); }