Passed
Push — master ( 3c32e6...6d1be7 )
by Adam
02:49
created

LiveDevTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 13
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testLiveDevDisable() 0 12 1
A testLiveDevEnable() 0 12 1
1
<?php
2
3
namespace AcquiaCloudApi\Tests\Endpoints;
4
5
use AcquiaCloudApi\Tests\CloudApiTestCase;
6
use AcquiaCloudApi\Endpoints\Environments;
7
8
class LiveDevTest extends CloudApiTestCase
9
{
10
11
    public function testLiveDevEnable()
12
    {
13
        $response = $this->getPsr7JsonResponseForFixture('Endpoints/Environments/enableLiveDev.json');
14
        $client = $this->getMockClient($response);
15
16
        /** @var \AcquiaCloudApi\CloudApi\ClientInterface $client */
17
        $environment = new Environments($client);
18
        $result = $environment->enableLiveDev('14-0c7e79ab-1c4a-424e-8446-76ae8be7e851');
19
20
        $this->assertInstanceOf('\AcquiaCloudApi\Response\OperationResponse', $result);
21
22
        $this->assertEquals('Live Dev is being enabled.', $result->message);
23
    }
24
25
    public function testLiveDevDisable()
26
    {
27
        $response = $this->getPsr7JsonResponseForFixture('Endpoints/Environments/disableLiveDev.json');
28
        $client = $this->getMockClient($response);
29
30
        /** @var \AcquiaCloudApi\CloudApi\ClientInterface $client */
31
        $environment = new Environments($client);
32
        $result = $environment->disableLiveDev('14-0c7e79ab-1c4a-424e-8446-76ae8be7e851');
33
34
        $this->assertInstanceOf('\AcquiaCloudApi\Response\OperationResponse', $result);
35
36
        $this->assertEquals('Live Dev is being disabled.', $result->message);
37
    }
38
}
39