diff --git a/doc/03-cli.md b/doc/03-cli.md index 043ce1801..2d5ad54a3 100644 --- a/doc/03-cli.md +++ b/doc/03-cli.md @@ -76,6 +76,8 @@ resolution. * **--dev:** By default composer will only install required packages. By passing this option you can also make it install packages referenced by `require-dev`. +* **--no-dev:** Skip installing packages listed in `require-dev` (this is + the default for `install`). * **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-custom-installers:** Disables custom installers. * **--no-progress:** Removes the progress display that can mess with some @@ -107,7 +109,8 @@ You can also use wildcards to update a bunch of packages at once: * **--prefer-source:** Install packages from `source` when available. * **--prefer-dist:** Install packages from `dist` when available. * **--dry-run:** Simulate the command without actually doing anything. -* **--dev:** Install packages listed in `require-dev`. +* **--dev:** Install packages listed in `require-dev` (this is the default for `update`). +* **--no-dev:** Skip installing packages listed in `require-dev`. * **--no-scripts:** Skips execution of scripts defined in `composer.json`. * **--no-custom-installers:** Disables custom installers. * **--no-progress:** Removes the progress display that can mess with some @@ -190,7 +193,6 @@ specific version. * **--installed (-i):** List the packages that are installed. * **--platform (-p):** List only platform packages (php & extensions). * **--self (-s):** List the root package info. -* **--dev:** Include dev-required packages when combined with **--installed** or **--platform**. ## depends diff --git a/doc/04-schema.md b/doc/04-schema.md index ed585b76d..74c7510de 100644 --- a/doc/04-schema.md +++ b/doc/04-schema.md @@ -296,17 +296,7 @@ unless those requirements can be met. Lists packages required for developing this package, or running tests, etc. The dev requirements of the root package only will be installed -if `install` or `update` is ran with `--dev`. - -Packages listed here and their dependencies can not overrule the resolution -found with the packages listed in require. This is even true if a different -version of a package would be installable and solve the conflict. The reason -is that `install --dev` produces the exact same state as just `install`, apart -from the additional dev packages. - -If you run into such a conflict, you can specify the conflicting package in -the require section and require the right version number to resolve the -conflict. +if `install` is run with `--dev` or if `update` is run without `--no-dev`. #### conflict diff --git a/tests/Composer/Test/Installer/InstallerInstallerTest.php b/tests/Composer/Test/Installer/InstallerInstallerTest.php index a53ad467c..c61182389 100644 --- a/tests/Composer/Test/Installer/InstallerInstallerTest.php +++ b/tests/Composer/Test/Installer/InstallerInstallerTest.php @@ -51,8 +51,8 @@ class InstallerInstallerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); $rm->expects($this->any()) - ->method('getLocalRepositories') - ->will($this->returnValue(array($this->repository))); + ->method('getLocalRepository') + ->will($this->returnValue($this->repository)); $this->io = $this->getMock('Composer\IO\IOInterface'); diff --git a/tests/Composer/Test/InstallerTest.php b/tests/Composer/Test/InstallerTest.php index 1e01ae345..69b292b7a 100644 --- a/tests/Composer/Test/InstallerTest.php +++ b/tests/Composer/Test/InstallerTest.php @@ -29,6 +29,19 @@ use Symfony\Component\Console\Output\StreamOutput; class InstallerTest extends TestCase { + protected $prevCwd; + + public function setUp() + { + $this->prevCwd = getcwd(); + chdir(__DIR__); + } + + public function tearDown() + { + chdir($this->prevCwd); + } + /** * @dataProvider provideInstaller */ diff --git a/tests/Composer/Test/Mock/InstallationManagerMock.php b/tests/Composer/Test/Mock/InstallationManagerMock.php index b643df728..0ecca1e2a 100644 --- a/tests/Composer/Test/Mock/InstallationManagerMock.php +++ b/tests/Composer/Test/Mock/InstallationManagerMock.php @@ -13,6 +13,7 @@ namespace Composer\Test\Mock; use Composer\Installer\InstallationManager; use Composer\Repository\RepositoryInterface; +use Composer\Repository\InstalledRepositoryInterface; use Composer\Package\PackageInterface; use Composer\DependencyResolver\Operation\InstallOperation; use Composer\DependencyResolver\Operation\UpdateOperation;