Skip to content

Commit d0da68f

Browse files
committed
Adds combining options test
1 parent eb79672 commit d0da68f

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

tests/Commands/ValidateCommandTest.php

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,50 @@ public function readmeIsNotInSuggestedFileContent(): void
499499
500500
Use the --create|-c option to create a .gitattributes file with the shown content.
501501
502+
CONTENT;
503+
504+
$this->assertSame($expectedDisplay, $commandTester->getDisplay());
505+
$this->assertTrue($commandTester->getStatusCode() > Command::SUCCESS);
506+
}
507+
508+
#[Test]
509+
public function licenseAndReadmeAreNotInSuggestedFileContent(): void
510+
{
511+
$artifactFilenames = [
512+
'CONDUCT.md',
513+
'phpspec.yml.dist',
514+
'License.md',
515+
'README.md'
516+
];
517+
518+
$this->createTemporaryFiles(
519+
$artifactFilenames,
520+
['specs', 'docs']
521+
);
522+
523+
$command = $this->application->find('validate');
524+
$commandTester = new CommandTester($command);
525+
$commandTester->execute([
526+
'command' => $command->getName(),
527+
'directory' => WORKING_DIRECTORY,
528+
'--keep-readme' => true,
529+
'--keep-license' => true,
530+
]);
531+
532+
$expectedDisplay = <<<CONTENT
533+
Warning: There is no .gitattributes file present in {$this->temporaryDirectory}.
534+
535+
Would expect the following .gitattributes file content:
536+
* text=auto eol=lf
537+
538+
.gitattributes export-ignore
539+
CONDUCT.md export-ignore
540+
docs/ export-ignore
541+
phpspec.yml.dist export-ignore
542+
specs/ export-ignore
543+
544+
Use the --create|-c option to create a .gitattributes file with the shown content.
545+
502546
CONTENT;
503547

504548
$this->assertSame($expectedDisplay, $commandTester->getDisplay());

0 commit comments

Comments
 (0)