Skip to content

Commit d7e7152

Browse files
committed
Test command availability
1 parent b61504d commit d7e7152

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

tests/ApplicationTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,36 @@ public function executableIsAvailable(): void
2323
);
2424
$this->assertEquals(0, $returnValue);
2525
}
26+
27+
#[Test]
28+
#[Group('integration')]
29+
public function commandsAreAddedToTheApplication(): void
30+
{
31+
$binaryCommand = 'php bin/git-user-bend list';
32+
33+
exec($binaryCommand, $output, $returnValue);
34+
35+
$expectedCommands = [
36+
'add',
37+
'export',
38+
'import',
39+
'pair',
40+
'unpair',
41+
'personas',
42+
'retire',
43+
'use',
44+
'reset',
45+
'whoami'
46+
];
47+
48+
foreach ($expectedCommands as $expectedCommand) {
49+
$this->assertStringContainsString(
50+
$expectedCommand,
51+
implode(PHP_EOL, $output),
52+
sprintf('Expected command %s not present.', $expectedCommand)
53+
);
54+
}
55+
56+
$this->assertEquals(0, $returnValue);
57+
}
2658
}

0 commit comments

Comments
 (0)