Pantheon\Terminus\UnitTests\Commands\Site\ListCommandTest::testListOrgSitesOnly PHP Метод

testListOrgSitesOnly() публичный Метод

Exercises site:list with no filters and belonging to an org
    public function testListOrgSitesOnly()
    {
        $dummy_info = ['name' => 'my-site', 'id' => 'site_id', 'service_level' => 'pro', 'framework' => 'cms', 'owner' => 'user_id', 'created' => '1984-07-28 16:40', 'memberships' => 'org_id: org_url'];
        $this->site->memberships = ['org_id: org_url'];
        $this->sites->expects($this->once())->method('fetch')->with($this->equalTo(['org_id' => 'org_id', 'team_only' => false]))->willReturn($this->sites);
        $this->sites->expects($this->never())->method('filterByName');
        $this->session->expects($this->never())->method('getUser');
        $this->sites->expects($this->never())->method('filterByOwner');
        $this->site->expects($this->any())->method('serialize')->with()->willReturn($dummy_info);
        $this->sites->expects($this->once())->method('all')->with()->willReturn([$this->site, $this->site]);
        $this->logger->expects($this->never())->method('log');
        $out = $this->command->index(['team' => false, 'owner' => null, 'org' => 'org_id', 'name' => null]);
        $this->assertInstanceOf(RowsOfFields::class, $out);
        $this->assertEquals([$dummy_info, $dummy_info], $out->getArrayCopy());
    }