コード例 #1
0
ファイル: ComposerTest.php プロジェクト: anime-db/anime-db
 /**
  * @dataProvider getConfigForRemovePackage
  *
  * @param array $before
  * @param array $after
  */
 public function testRemovePackage(array $before, array $after)
 {
     file_put_contents($this->filename, $this->encode($before));
     $this->manipulator->removePackage('foo');
     // test
     $this->assertEquals($this->encode($after), file_get_contents($this->filename));
 }
コード例 #2
0
ファイル: ProjectTest.php プロジェクト: anime-db/app-bundle
 public function testOnInstalledOrUpdatedAddShmop()
 {
     if (extension_loaded('shmop')) {
         $this->composer->expects($this->once())->method('addPackage')->with('anime-db/shmop', '1.0.*');
     } else {
         $this->composer->expects($this->once())->method('removePackage')->with('anime-db/shmop');
     }
     $this->listener->onInstalledOrUpdatedAddShmop();
 }
コード例 #3
0
ファイル: Project.php プロジェクト: anime-db/app-bundle
 /**
  * On installed or updated try add a Shmop package.
  */
 public function onInstalledOrUpdatedAddShmop()
 {
     // if the extension shmop is installed, can use the appropriate driver for store the key cache
     if (extension_loaded('shmop')) {
         $this->composer->addPackage('anime-db/shmop', '1.0.*');
     } else {
         $this->composer->removePackage('anime-db/shmop');
     }
 }