-
Notifications
You must be signed in to change notification settings - Fork 195
Make site label available to site:list and org:site:list commands #2708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 9 commits
5bcf557
9d2aaba
84995a4
40f9659
185c263
e4cd28a
8a3c34e
14bb30e
0ef428d
98eff53
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -153,6 +153,85 @@ public function testOrgSiteListCommand() | |
| ); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| * @covers \Pantheon\Terminus\Commands\Org\Site\ListCommand | ||
| * | ||
| * @group org | ||
| * @group short | ||
| */ | ||
| public function testOrgSiteListCommandWithLabelField() | ||
| { | ||
| $orgSites = $this->terminusJsonResponse( | ||
| sprintf( | ||
| "org:site:list --fields=id,label %s", | ||
| $this->getOrg() | ||
| ) | ||
| ); | ||
| $this->assertIsArray( | ||
| $orgSites, | ||
| "Response from org list should be an array of orgs" | ||
| ); | ||
| $site = array_shift($orgSites); | ||
|
|
||
| $this->assertIsArray( | ||
| $site, | ||
| "row from org list array of orgs should be an org item" | ||
| ); | ||
| $this->assertArrayHasKey( | ||
| 'id', | ||
| $site, | ||
| "Sites from org list should have an id property" | ||
| ); | ||
| $this->assertArrayHasKey( | ||
| 'label', | ||
| $site, | ||
| "Sites from org list should have a name property" | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| * @covers \Pantheon\Terminus\Commands\Org\Site\ListCommand | ||
| * | ||
| * @group org | ||
| * @group short | ||
| */ | ||
| public function testOrgSiteListCommandWithLabelFilter() | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know I'm the one that asked for stuff to be broken out to more cases— consider whether every assertion still should be in the subsequent filter test or not.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe this comment is stale, but the 4 assertions i see below all look reasonable to me, especially considering that none of their arguments include method calls so on the surface it appears that they should all be very computationally inexpensive. |
||
| { | ||
| $partial_site_name = substr($this->getSiteName(), 0, -1); | ||
| $orgSites = $this->terminusJsonResponse( | ||
| sprintf( | ||
| "org:site:list --fields=id,label --filter='label*=%s' %s", | ||
| $partial_site_name, | ||
| $this->getOrg() | ||
| ) | ||
| ); | ||
| $this->assertIsArray( | ||
| $orgSites, | ||
| "Response from org list should be an array of orgs" | ||
| ); | ||
|
|
||
| $this->assertGreaterThan(0, count($orgSites)); | ||
|
|
||
| $site = array_shift($orgSites); | ||
|
|
||
| $this->assertIsArray( | ||
| $site, | ||
| "row from org list array of orgs should be an org item" | ||
| ); | ||
| $this->assertArrayHasKey( | ||
| 'id', | ||
| $site, | ||
| "Sites from org list should have an id property" | ||
| ); | ||
| $this->assertArrayHasKey( | ||
| 'label', | ||
| $site, | ||
| "Sites from org list should have a name property" | ||
| ); | ||
| } | ||
|
|
||
| /** | ||
| * @test | ||
| * @covers \Pantheon\Terminus\Commands\Org\Upstream\ListCommand | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.