Skip to content

Commit d19d97f

Browse files
authored
Fix tests & add client tests
1 parent a059338 commit d19d97f

1 file changed

Lines changed: 18 additions & 3 deletions

File tree

tests/OrgManagerTest.php

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ class OrgManagerTest extends \PHPUnit_Framework_TestCase
1212

1313
public function setUp()
1414
{
15-
$client = new Client();
16-
17-
$this->orgmanager = new OrgManager($client);
15+
$this->orgmanager = new OrgManager();
1816

1917
parent::setUp();
2018
}
@@ -31,4 +29,21 @@ public function you_can_set_api_token()
3129
$this->orgmanager->connect('API_TOKEN');
3230
$this->assertEquals('API_TOKEN', $this->orgmanager->apiToken);
3331
}
32+
33+
/** @test */
34+
public function you_can_get_client()
35+
{
36+
$this->assertEquals($this->orgmanager->getClient(), $this->orgmanager->client);
37+
$this->assertInstanceOf(Client::class, $this->orgmanager->getClient());
38+
}
39+
40+
/** @test */
41+
public function you_can_set_client()
42+
{
43+
$newClient = new Client;
44+
$this->assertInstanceOf(Client::class, $newClient);
45+
$this->assertNotEquals($this->orgmanager->client, $newClient)
46+
$this->orgmanager->setClient($newClient);
47+
$this->assertEquals($newClient, $this->orgmanager->client);
48+
}
3449
}

0 commit comments

Comments
 (0)