-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Tjvb\GitHash\Tests\HashFinders; | ||
|
||
use TJVB\GitHash\Exceptions\GitHashException; | ||
use TJVB\GitHash\HashFinders\GitFileSystemHashFinder; | ||
use TJVB\GitHash\HashFinders\GitProcessCommandHashFinder; | ||
use TJVB\GitHash\HashFinders\GitShellExecCommandHashFinder; | ||
use TJVB\GitHash\Tests\TestCase; | ||
use TJVB\GitHash\Values\GitHash; | ||
|
||
class GitShellExecCommandHashFinderTest extends TestCase | ||
{ | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function weSeeThatTheFinderIsAvailable(): void | ||
{ | ||
// setup / mock | ||
|
||
// run | ||
$finder = new GitShellExecCommandHashFinder(); | ||
|
||
// verify/assert | ||
$this->assertTrue($finder->isAvailable()); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function weCanFindAHashFromTheRepositoryRoot(): void | ||
{ | ||
// setup / mock | ||
|
||
// run | ||
$finder = new GitShellExecCommandHashFinder(); | ||
$result = $finder->findHash(self::PROJECT_ROOT); | ||
|
||
// verify/assert | ||
// @TODO work with a fixed git directory to get a fixed hash | ||
$this->assertInstanceOf(GitHash::class, $result); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function weCanFindAHashFromASubDirectory(): void | ||
{ | ||
// setup / mock | ||
|
||
// run | ||
$finder = new GitShellExecCommandHashFinder(); | ||
$result = $finder->findHash(self::PROJECT_ROOT); | ||
|
||
// verify/assert | ||
// @TODO work with a fixed git directory to get a fixed hash | ||
$this->assertInstanceOf(GitHash::class, $result); | ||
} | ||
} |