-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds other simple application commmand tests
- Loading branch information
Showing
5 changed files
with
75 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,4 @@ acquiacli.yml | |
robo.yml | ||
vendor | ||
.idea | ||
tests/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?php | ||
|
||
namespace AcquiaCli\Tests\Commands; | ||
|
||
use AcquiaCli\Tests\AcquiaCliTestCase; | ||
|
||
class ApplicationCommandTest extends AcquiaCliTestCase | ||
{ | ||
|
||
/** | ||
* @dataProvider applicationProvider | ||
*/ | ||
public function testApplicationCommands($command, $fixture, $expected) | ||
{ | ||
$psr7Response = $this->getPsr7JsonResponseForFixture($fixture); | ||
$client = $this->getMockClient($psr7Response); | ||
|
||
$actualResponse = $this->execute($client, $command); | ||
|
||
$this->assertSame($expected, $actualResponse); | ||
} | ||
|
||
public function applicationProvider() | ||
{ | ||
$getAllApplications = '+----------------------+--------------------------------------+--------------------+ | ||
| Name | UUID | Hosting ID | | ||
+----------------------+--------------------------------------+--------------------+ | ||
| Sample application 1 | a47ac10b-58cc-4372-a567-0e02b2c3d470 | devcloud:devcloud2 | | ||
| Sample application 2 | a47ac10b-58cc-4372-a567-0e02b2c3d471 | devcloud:devcloud2 | | ||
+----------------------+--------------------------------------+--------------------+ | ||
'; | ||
|
||
$getTags = '+------+--------+ | ||
| Name | Color | | ||
+------+--------+ | ||
| Dev | orange | | ||
+------+--------+ | ||
'; | ||
|
||
return [ | ||
[ | ||
['application:list'], | ||
'Applications/getAllApplications.json', | ||
$getAllApplications | ||
|
||
], | ||
[ | ||
['application:tags', 'uuid'], | ||
'Applications/getAllTags.json', | ||
$getTags | ||
], | ||
[ | ||
['application:tag:create', 'uuid', 'name', 'color'], | ||
'Applications/createTag.json', | ||
'> Creating application tag name:color' . PHP_EOL | ||
], | ||
[ | ||
['application:tag:delete', 'uuid', 'name'], | ||
'Applications/deleteTag.json', | ||
'> Deleting application tag name' . PHP_EOL | ||
] | ||
]; | ||
} | ||
} |
Empty file.