Example #1
0
 public function update()
 {
     $dir = $this->getDirectory();
     $updater = new \Dxw\Whippet\Dependencies\Updater($this->factory, $dir);
     $installer = new \Dxw\Whippet\Dependencies\Installer($this->factory, $dir);
     $this->exitIfError($updater->update());
     $this->exitIfError($installer->install());
 }
Example #2
0
 public function testInstallBlankLockfile()
 {
     $dir = $this->getDir();
     file_put_contents($dir . '/whippet.json', 'foobar');
     file_put_contents($dir . '/whippet.lock', 'foobar');
     $whippetLock = $this->getWhippetLock(sha1('foobar'), ['themes' => [], 'plugins' => []]);
     $this->addFactoryCallStatic('\\Dxw\\Whippet\\Files\\WhippetLock', 'fromFile', $dir . '/whippet.lock', \Result\Result::ok($whippetLock));
     $dependencies = new \Dxw\Whippet\Dependencies\Installer($this->getFactory(), $this->getProjectDirectory($dir));
     ob_start();
     $result = $dependencies->install();
     $output = ob_get_clean();
     $this->assertFalse($result->isErr());
     $this->assertEquals("whippet.lock contains nothing to install\n", $output);
 }