-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGhostTest.php
More file actions
47 lines (38 loc) · 1.1 KB
/
Copy pathGhostTest.php
File metadata and controls
47 lines (38 loc) · 1.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace M1guelpf\GhostAPI\Test;
use GuzzleHttp\Client;
class GhostTest extends \PHPUnit\Framework\TestCase
{
/** @var \M1guelpf\GhostAPI\Ghost */
protected $ghost;
public function setUp()
{
parent::setUp();
$this->ghost = new Ghost();
}
/** @test */
public function it_does_not_have_token()
{
$this->assertNull($this->ghost->apiToken);
}
/** @test */
public function you_can_set_api_token()
{
$this->ghost->connect('API_TOKEN');
$this->assertEquals('API_TOKEN', $this->ghost->apiToken);
}
/** @test */
public function you_can_get_client()
{
$this->assertInstanceOf(Client::class, $this->ghost->getClient());
}
/** @test */
public function you_can_set_client()
{
$newClient = new Client(['base_uri' => 'http://foo.bar']);
$this->assertInstanceOf(Client::class, $newClient);
$this->assertNotEquals($this->ghost->getClient(), $newClient);
$this->ghost->setClient($newClient);
$this->assertEquals($newClient, $this->ghost->getClient());
}
}