Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Commit

Permalink
Test updated
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorkmaz committed Jul 11, 2018
1 parent 7ffc483 commit 418ab04
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
},
"require-dev": {
"codeception/codeception": "^2.4",
"php-coveralls/php-coveralls": "~1.1"
"php-coveralls/php-coveralls": "~1.1",
"sebastian/version": "^2.0"

},
"autoload": {
Expand Down
14 changes: 7 additions & 7 deletions tests/unit/Git/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Codeception\Test\Unit;
use Selami\Stdlib\Git\Version;

use SebastianBergmann\Version as SBVersion;
class VersionTest extends Unit
{
/**
Expand All @@ -26,13 +26,13 @@ protected function _after()
*/
public function shouldReturnShortGitVersion() : void
{
$fileName = \dirname(__DIR__, 3).'/.git/refs/heads/master';
if (!file_exists($fileName)) {
\file_put_contents($fileName, 'kedibey9--');
}
$expected = substr(file_get_contents(dirname(__DIR__, 3).'/.git/refs/heads/master'), 0, 7);
$path = dirname(__DIR__, 3);
$version = new SBVersion(
'1.0.0', $path
);
$haystack = $version->getVersion();
$result = Version::short();
$this->assertEquals($expected, $result);
$this->assertContains($result, $haystack);
}

}

0 comments on commit 418ab04

Please sign in to comment.