Skip to content

Commit

Permalink
Fix StraussConfig mocks to return isIncludeModifiedDate true
Browse files Browse the repository at this point in the history
  • Loading branch information
BrianHenryIE committed Aug 26, 2021
1 parent 9358549 commit 26cb474
Showing 1 changed file with 21 additions and 7 deletions.
28 changes: 21 additions & 7 deletions tests/Unit/LicenserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ public function testAppendHeaderCommentInformationNoHeader()

$author = 'BrianHenryIE';

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$sut = new Licenser($config, __DIR__, array(), $author);

$given = <<<'EOD'
Expand Down Expand Up @@ -118,7 +120,9 @@ public function testAppendHeaderCommentInformationNoHeader()
public function testWithLicenceAlreadyInHeader(): void
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down Expand Up @@ -169,7 +173,9 @@ public function testWithLicenceAlreadyInHeader(): void
public function testWithTwoCommentsBeforeFirstCode()
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down Expand Up @@ -230,7 +236,9 @@ public function testWithTwoCommentsBeforeFirstCode()
public function testUnusualHeaderCommentStyle()
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down Expand Up @@ -275,7 +283,9 @@ public function testUnusualHeaderCommentStyle()
public function testCommentWithLicenseWord()
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down Expand Up @@ -334,7 +344,9 @@ public function testCommentWithLicenseWord()
public function testIncorrectlyMatching()
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down Expand Up @@ -404,7 +416,9 @@ public function testIncorrectlyMatching()
public function testLicenseDetailsOnlyInsertedOncePerFile()
{

$config = $this->createStub(StraussConfig::class);
$config = $this->createMock(StraussConfig::class);
$config->expects($this->once())->method('isIncludeModifiedDate')->willReturn(true);

$author = 'BrianHenryIE';
$sut = new Licenser($config, __DIR__, array(), $author);

Expand Down

0 comments on commit 26cb474

Please sign in to comment.