Skip to content

Commit

Permalink
Added composer JSON tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Ivar van der Burg committed Apr 7, 2015
1 parent 3aa2d27 commit 00a17cc
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/Reader/ComposerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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));
}
}
24 changes: 24 additions & 0 deletions tests/projects/composer/composer.json
Original file line number Diff line number Diff line change
@@ -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": "[email protected]"
}
],

"autoload": {
"psr-4": {"Naneau\\ProjectVersioner\\": "src/Naneau/ProjectVersioner/"}
},

"minimum-stability": "stable",
"require": {
"symfony/finder": "~2.5"
},
"require-dev": {
"phpunit/phpunit": "~4.2"
}
}

0 comments on commit 00a17cc

Please sign in to comment.