Skip to content

Commit

Permalink
rework generation of composer object
Browse files Browse the repository at this point in the history
  • Loading branch information
Flyingmana committed Nov 5, 2020
1 parent c7592f2 commit 17d06df
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions tests/MagentoHackathon/Composer/Magento/PluginTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,15 @@ class PluginTest extends \PHPUnit_Framework_TestCase
protected $plugin;
protected $eventManager;

private function buildComposerObject()
{
return \Composer\Factory::create($this->io);
}

public function setUp()
{
$this->composer = new Composer;
$this->io = new \Composer\IO\NullIO();
$this->composer = $this->buildComposerObject();
$this->config = $this->getMock('Composer\Config');
$this->composer->setConfig($this->config);
$this->root = vfsStream::setup('root', null, array('vendor' => array('bin' => array()), 'htdocs' => array()));
Expand All @@ -58,17 +64,16 @@ public function setUp()
),
)));

$this->composer->setInstallationManager(new InstallationManager());

$this->io = $this->getMock('Composer\IO\IOInterface');

$this->plugin = $this->getMockBuilder('MagentoHackathon\Composer\Magento\Plugin')
->setMethods(array('getEventManager', 'getModuleManager'))
->getMock();

$repoManager = new RepositoryManager($this->io, $this->config);
$repoManager->setLocalRepository(new WritableArrayRepository);
$this->composer->setRepositoryManager($repoManager);
$repoManager = \Composer\Repository\RepositoryFactory::manager(
$this->io,
$this->config,
\Composer\Factory::createHttpDownloader($this->io, $this->config)
);

$this->eventManager = $this->getMock('MagentoHackathon\Composer\Magento\Event\EventManager');
$this->plugin
Expand Down

0 comments on commit 17d06df

Please sign in to comment.