Skip to content

Commit d03da2b

Browse files
committed
tests: add tests for setVersion on Doctum class
1 parent de16fbe commit d03da2b

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/DoctumTest.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,31 @@ public function testBasicNoGitCustomNameIntegration(): void
106106
], $project->getVersions());
107107
}
108108

109+
public function testCliOnlyVersion(): void
110+
{
111+
$iterator = Finder::create()
112+
->files()
113+
->name('*.php')
114+
->exclude('stubs')
115+
->exclude('database')
116+
->exclude('bootstrap')
117+
->exclude('storage')
118+
->in($dir = __DIR__);
119+
120+
$doctum = new Doctum($iterator, [
121+
'remote_repository' => new GitHubRemoteRepository('RepoName', dirname($dir)),
122+
]);
123+
$doctum->setVersion('fouBar');
124+
$project = $doctum->getProject();
125+
$this->assertInstanceOf(Project::class, $project);
126+
$this->assertEquals([
127+
new Version(
128+
'fouBar',
129+
'fouBar'
130+
)
131+
], $project->getVersions());
132+
}
133+
109134
public function testAdvancedHackyIntegration(): void
110135
{
111136
$iterator = Finder::create()

0 commit comments

Comments
 (0)