/** * @test */ public function installShouldCreateCacheDir() { $src = self::$fixturesDirectory . '/config'; $configuration = $this->createConfig($src); $this->eventDispatcher->addSubscriber(new CacheCreateListener($this->bower)); $this->bower->install($configuration); $this->assertFileExists($this->target . '/cache'); }
/** * {@inheritdoc} */ public function warmUp($cacheDir) { if (!$this->install) { return; } foreach ($this->bowerManager->getBundles() as $config) { $this->bower->install($config); } }
/** * @expectedException \Sp\BowerBundle\Bower\Exception\RuntimeException */ public function testUnsuccessfulInstallThrowsRuntimeException() { $jsonString = file_get_contents(self::$fixturesDirectory . '/error.json'); $configDir = "/config_dir"; $config = new Configuration($configDir); $config->setCache($this->cache); $this->processBuilder->expects($this->once())->method('getProcess')->will($this->returnValue($this->process)); $this->process->expects($this->once())->method('isSuccessful')->will($this->returnValue(false)); $this->process->expects($this->once())->method('getErrorOutput')->will($this->returnValue($jsonString)); $this->bower->install($config); }