/** * @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)); }
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(); }
/** * 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'); } }