Consolidation\Cgr\CgrTests::testApplicationWithComposer PHP Method

testApplicationWithComposer() public method

Functional test with the real composer executable. Use cgr to require cgr, although we do so with --no-update to avoid pointlessly downloading files we do not actually need. We therefore only test to see whether the composer.json file is correctly updated; we cannot test to see if the cgr binary is correctly installed in the appropriate bin directory, as this step is not done.
    public function testApplicationWithComposer()
    {
        $argv = array('composer', '--no-update', 'consolidation/cgr:1.0');
        $exitCode = $this->application->run($argv, $this->workDir);
        $this->assertEquals(0, $exitCode);
        $this->assertFileExists($this->workDir . '/.composer/global/consolidation/cgr/composer.json', 'composer.json created');
        $composerJson = file_get_contents($this->workDir . '/.composer/global/consolidation/cgr/composer.json');
        $this->assertContains('"consolidation/cgr": "1.0"', $composerJson);
    }