Example #1
0
 /**
  * @group blackfire
  * @requires extension blackfire
  * @dataProvider getStorageData
  */
 public function testStorage($primedCache, $writeCalls, $readCalls)
 {
     $sami = $this->sami;
     if ($primedCache) {
         // prime the cache
         $sami['project']->parse();
     }
     $config = new Profile\Configuration();
     $config->defineMetric(new Profile\Metric('sami.storage.write_calls', array('=Sami\\Store\\JsonStore::writeClass')))->defineMetric(new Profile\Metric('sami.storage.read_calls', array('=Sami\\Reflection\\ClassReflection::fromArray')))->assert('metrics.sami.storage.write_calls.count == ' . $writeCalls, $writeCalls . ' write calls')->assert('metrics.sami.storage.read_calls.count <= ' . $readCalls, $readCalls . ' read calls');
     $profile = $this->getBlackfireClient()->assertPhpUnit($this, $config, function () use($sami) {
         $sami['project']->parse();
     });
 }