ClientTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 2
Bugs 0 Features 2
Metric Value
wmc 3
c 2
b 0
f 2
lcom 0
cbo 6
dl 0
loc 26
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A testFullMethodsDataEntry() 0 8 1
A testClient() 0 9 1
A tearDown() 0 4 1
1
<?php
2
3
namespace CarlosIO\Geckoboard\Tests;
4
5
use CarlosIO\Geckoboard\Client as Geckoboard;
6
use Guzzle\Common\Collection;
7
8
class ClientTest extends \PHPUnit_Framework_TestCase
9
{
10
    public function testFullMethodsDataEntry()
11
    {
12
        $client = new Geckoboard();
13
        $this->assertSame('foo', $client->setApiKey('foo')->getApiKey());
14
        $config = new Collection(array('timeout' => 10, 'connect_timeout' => 1));
15
        $this->assertSame($config, $client->setGuzzleConfig($config)->getGuzzleConfig());
16
        $this->assertSame(10, $client->getGuzzleConfig('timeout'));
17
    }
18
19
    public function testClient()
20
    {
21
        $widget = \Mockery::mock('CarlosIO\Geckoboard\Widgets\Widget');
22
        $widget->shouldReceive('getId')->andReturn('1');
23
        $widget->shouldReceive('getData')->andReturn(array(1, 2, 3));
24
25
        $client = new DummyClient();
26
        $client->push($widget);
27
    }
28
29
    protected function tearDown()
30
    {
31
        \Mockery::close();
32
    }
33
}
34