/** * @dataProvider getConfigForAddPackage * * @param array $before * @param array $after */ public function testAddPackage(array $before, array $after) { file_put_contents($this->filename, $this->encode($before)); $this->manipulator->addPackage('foo', '1.0.0'); // test $this->assertEquals($this->encode($after), file_get_contents($this->filename)); }
/** * 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'); } }