/** * @test * @dataProvider stylesheetCachingParametersProvider */ public function dontCacheStylesheetConstraintByDefault($numberOfCacheMethodInvoking, $useCache) { $facade = new Facade(new LoaderImpl(), $this->createDocumentStub(), $this->documentParser, $this->stylesheetParser); $cache = $this->getMock('PHPPdf\\Cache\\NullCache', array('test', 'save', 'load')); $cache->expects($this->exactly($numberOfCacheMethodInvoking))->method('test')->will($this->returnValue(false)); $cache->expects($this->exactly(0))->method('load'); $cache->expects($this->exactly($numberOfCacheMethodInvoking))->method('save'); $this->documentParser->expects($this->once())->method('parse')->will($this->returnValue(new \PHPPdf\Core\Node\PageCollection())); $this->stylesheetParser->expects($this->once())->method('parse')->will($this->returnValue(new \PHPPdf\Core\Parser\CachingStylesheetConstraint())); $facade->setCache($cache); $facade->setUseCacheForStylesheetConstraint($useCache); $facade->render('<pdf></pdf>', '<stylesheet></stylesheet>'); }