ClientTest::testClient()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 0
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