Пример #1
0
 /**
  * @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
 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
 /**
  * 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');
     }
 }