Skip to content

Commit

Permalink
Fix: composer 9999999-dev issue (#422)
Browse files Browse the repository at this point in the history
* Fix: composer 9999999-dev issue

* Fix: add test for 9999999-dev issue
  • Loading branch information
slappyslap authored Mar 2, 2021
1 parent c50b53e commit 77fb968
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Service/Dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function version(): string
return md5($this->version);
}

if ($this->version === 'dev-master') {
return '9999999-dev';
}

return $this->version;
}

Expand Down
7 changes: 7 additions & 0 deletions tests/Unit/DistTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,11 @@ public function testVersionWithSlash(): void

self::assertEquals(md5('dev-master/feature'), $dist->version());
}

public function testVersionDevMaster(): void
{
$dist = new Dist('repo', 'package', 'dev-master', '123456', 'zip');

self::assertEquals('9999999-dev', $dist->version());
}
}

0 comments on commit 77fb968

Please sign in to comment.