API/tests/AccountTest.php

50 lines
1014 B
PHP
Raw Permalink Normal View History

2017-09-29 15:58:43 +02:00
<?php
namespace Shikiryu\LBCReposter;
use Goutte\Client;
use PHPUnit\Framework\TestCase;
use Shikiryu\LBCReposter\Account;
class AccountTest extends TestCase
{
protected $account;
protected function setUp()
{
$config = new \Shikiryu\LBCReposter\Config([
'login' => 'text@example.com',
'password' => 'password',
]);
$this->account = new Account($config);
}
protected function tearDown()
{
$this->account = null;
}
public function testGetConfig()
2017-09-29 15:58:43 +02:00
{
$result = $this->account->getConfig();
$this->assertInstanceOf( \Shikiryu\LBCReposter\Config::class, $result );
}
public function testGetClient()
{
$client = $this->account->getClient();
$this->assertInstanceOf( Client::class, $client );
}
public function testIsNotConnected()
{
$this->assertFalse($this->account->isConnected());
}
public function testIsConnected()
{
$this->account->setConnected(true);
$this->assertTrue($this->account->isConnected());
}
2017-09-29 15:58:43 +02:00
}