diff --git a/tests/Reader/ComposerTest.php b/tests/Reader/ComposerTest.php index aade2a7..5191f39 100644 --- a/tests/Reader/ComposerTest.php +++ b/tests/Reader/ComposerTest.php @@ -3,6 +3,7 @@ use Naneau\ProjectVersioner\Versioner; use Naneau\ProjectVersioner\Reader\Composer as ComposerReader; use Naneau\ProjectVersioner\Reader\ComposerPackage as ComposerPackageReader; +use Naneau\ProjectVersioner\Reader\ComposerJson as ComposerJsonReader; class ComposerTest extends \PHPUnit_Framework_TestCase { @@ -27,4 +28,14 @@ public function testPackageRead() $this->assertEquals('v2.5.4', $versioner->get($directory)); } + + public function testComposerJsonRead() + { + $directory = __DIR__ . '/../projects/composer'; + + $readers = array(new ComposerJsonReader); + $versioner = new Versioner($readers); + + $this->assertEquals('1.0.0', $versioner->get($directory)); + } } diff --git a/tests/projects/composer/composer.json b/tests/projects/composer/composer.json new file mode 100644 index 0000000..e59b9ac --- /dev/null +++ b/tests/projects/composer/composer.json @@ -0,0 +1,24 @@ +{ + "name": "naneau/project-versioner", + "description": "A tool to maintain project/sub-project versions based on Composer, file mtimes, etc.", + "license": "MIT", + "version": "1.0.0", + "authors": [ + { + "name": "Maurice Fonk", + "email": "maurice@naneau.net" + } + ], + + "autoload": { + "psr-4": {"Naneau\\ProjectVersioner\\": "src/Naneau/ProjectVersioner/"} + }, + + "minimum-stability": "stable", + "require": { + "symfony/finder": "~2.5" + }, + "require-dev": { + "phpunit/phpunit": "~4.2" + } +}