Skip to content

Commit 54f42ae

Browse files
committed
Update the template path
1 parent c6c1a62 commit 54f42ae

6 files changed

+11
-4
lines changed

adr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
directory: docs/arch
22
template:
3-
decision-record: template/skeleton.md
3+
decision-record: vendor/globtec/phpadr/template/skeleton.md

tests/Command/MakeDecisionCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ public function testExecute()
8989
$vfs = vfsStream::setup();
9090
$configContent = file_get_contents('adr.yml');
9191
$configContent = str_replace('docs/arch', $vfs->url(), $configContent);
92+
$configContent = str_replace('vendor/globtec/phpadr/', '', $configContent);
9293
$configFile = vfsStream::newFile('adr.yml')->at($vfs)->setContent($configContent)->url();
9394

9495
(new Application())->add($this->command);

tests/Command/WorkspaceCountCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function testExecute()
6262
$vfs = vfsStream::setup();
6363
$configContent = file_get_contents('adr.yml');
6464
$configContent = str_replace('docs/arch', $vfs->url(), $configContent);
65+
$configContent = str_replace('vendor/globtec/phpadr/', '', $configContent);
6566
$configFile = vfsStream::newFile('adr.yml')->at($vfs)->setContent($configContent)->url();
6667

6768
$input = [

tests/Command/WorkspaceListCommandTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ public function testExecute()
6262
$vfs = vfsStream::setup();
6363
$configContent = file_get_contents('adr.yml');
6464
$configContent = str_replace('docs/arch', $vfs->url(), $configContent);
65+
$configContent = str_replace('vendor/globtec/phpadr/', '', $configContent);
6566
$configFile = vfsStream::newFile('adr.yml')->at($vfs)->setContent($configContent)->url();
6667

6768
$input = [

tests/Domain/DecisionRecordTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class DecisionRecordTest extends TestCase
1414
private $content;
1515

1616
/**
17-
* @var Config
17+
* @var Config|MockObject
1818
*/
1919
private $config;
2020

@@ -24,7 +24,9 @@ public function setUp()
2424
->disableOriginalConstructor()
2525
->getMock();
2626

27-
$this->config = new Config('adr.yml');
27+
$this->config = $this->getMockBuilder(Config::class)
28+
->disableOriginalConstructor()
29+
->getMock();
2830
}
2931

3032
public function testFilename()
@@ -43,6 +45,8 @@ public function testOutput()
4345
$this->content->expects($this->once())->method('getTitle')->willReturn('Foo');
4446
$this->content->expects($this->once())->method('getStatus')->willReturn('Accepted');
4547

48+
$this->config->expects($this->any())->method('decisionRecordTemplateFile')->willReturn('template/skeleton.md');
49+
4650
$record = new DecisionRecord($this->content, $this->config);
4751

4852
$output = $record->output();

tests/Filesystem/ConfigTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public function testInstanceSuccessfully()
1313
$config = new Config(__DIR__ . '/../../adr.yml');
1414

1515
$this->assertEquals('docs/arch', $config->directory());
16-
$this->assertEquals('template/skeleton.md', $config->decisionRecordTemplateFile());
16+
$this->assertEquals('vendor/globtec/phpadr/template/skeleton.md', $config->decisionRecordTemplateFile());
1717
}
1818

1919
public function testInstanceNotExistingFailure()

0 commit comments

Comments
 (0)