public function testRequestInstallAndRemove() { $repo = new ArrayRepository(); $foo = $this->getPackage('foo', '1'); $bar = $this->getPackage('bar', '1'); $foobar = $this->getPackage('foobar', '1'); $repo->addPackage($foo); $repo->addPackage($bar); $repo->addPackage($foobar); $request = new Request(); $request->install('foo'); $request->fix('bar'); $request->remove('foobar'); $this->assertEquals(array(array('cmd' => 'install', 'packageName' => 'foo', 'constraint' => null, 'fixed' => false), array('cmd' => 'install', 'packageName' => 'bar', 'constraint' => null, 'fixed' => true), array('cmd' => 'remove', 'packageName' => 'foobar', 'constraint' => null, 'fixed' => false)), $request->getJobs()); }
public function testRequestInstallAndRemove() { $pool = new Pool(); $repo = new ArrayRepository(); $foo = $this->getPackage('foo', '1'); $bar = $this->getPackage('bar', '1'); $foobar = $this->getPackage('foobar', '1'); $repo->addPackage($foo); $repo->addPackage($bar); $repo->addPackage($foobar); $pool->addRepository($repo); $request = new Request($pool); $request->install('foo'); $request->install('bar'); $request->remove('foobar'); $this->assertEquals(array(array('packages' => array($foo), 'cmd' => 'install', 'packageName' => 'foo'), array('packages' => array($bar), 'cmd' => 'install', 'packageName' => 'bar'), array('packages' => array($foobar), 'cmd' => 'remove', 'packageName' => 'foobar')), $request->getJobs()); }