From 6d38709fe8d15629f2c7ebbe434e66c41089b5ff Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Sat, 10 Nov 2012 19:42:29 +0100 Subject: [PATCH] Fix create project test --- tests/Composer/Test/AllFunctionalTest.php | 12 +++++ ...ject-shows-full-hash-for-dev-packages.test | 2 +- .../Test/Fixtures/functional/packages.json | 44 +++++++++++++++++++ 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 tests/Composer/Test/Fixtures/functional/packages.json diff --git a/tests/Composer/Test/AllFunctionalTest.php b/tests/Composer/Test/AllFunctionalTest.php index 134bc8061..cbb29a64b 100644 --- a/tests/Composer/Test/AllFunctionalTest.php +++ b/tests/Composer/Test/AllFunctionalTest.php @@ -11,6 +11,18 @@ use Symfony\Component\Finder\Finder; */ class AllFunctionalTest extends \PHPUnit_Framework_TestCase { + protected $oldcwd; + public function setUp() + { + $this->oldcwd = getcwd(); + chdir(__DIR__.'/Fixtures/functional'); + } + + public function tearDown() + { + chdir($this->oldcwd); + } + /** * @dataProvider getTestFiles */ diff --git a/tests/Composer/Test/Fixtures/functional/create-project-shows-full-hash-for-dev-packages.test b/tests/Composer/Test/Fixtures/functional/create-project-shows-full-hash-for-dev-packages.test index d068bd087..0e5188e41 100644 --- a/tests/Composer/Test/Fixtures/functional/create-project-shows-full-hash-for-dev-packages.test +++ b/tests/Composer/Test/Fixtures/functional/create-project-shows-full-hash-for-dev-packages.test @@ -1,4 +1,4 @@ --RUN-- -create-project seld/jsonlint %testDir% dev-master +create-project --repository-url=packages.json -v seld/jsonlint %testDir% dev-master --EXPECT-REGEX-- {^Installing seld/jsonlint \(dev-master [a-f0-9]{40}\)} diff --git a/tests/Composer/Test/Fixtures/functional/packages.json b/tests/Composer/Test/Fixtures/functional/packages.json new file mode 100644 index 000000000..b7ac3d53d --- /dev/null +++ b/tests/Composer/Test/Fixtures/functional/packages.json @@ -0,0 +1,44 @@ +[ + { + "name": "seld/jsonlint", + "description": "JSON Linter", + "keywords": [ + "json", + "parser", + "linter", + "validator" + ], + "homepage": "", + "version": "dev-master", + "version_normalized": "9999999-dev", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be", + "role": "Developer" + } + ], + "source": { + "type": "git", + "url": "http://github.com/Seldaek/jsonlint", + "reference": "4451f2066efdc53f3fa954c44a47ead73f6838d2" + }, + "type": "library", + "time": "2012-08-13T07:00:11+00:00", + "autoload": { + "psr-0": { + "Seld\\JsonLint": "src/" + } + }, + "bin": [ + "bin/jsonlint" + ], + "require": { + "php": ">=5.3.0" + } + } +] \ No newline at end of file