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;
|
|
|
|
}
|
|
|
|
|
2017-09-30 15:42:28 +02:00
|
|
|
public function testGetConfig()
|
2017-09-29 15:58:43 +02:00
|
|
|
{
|
|
|
|
$result = $this->account->getConfig();
|
|
|
|
$this->assertInstanceOf( \Shikiryu\LBCReposter\Config::class, $result );
|
|
|
|
}
|
|
|
|
|
2017-09-30 15:42:28 +02:00
|
|
|
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
|
|
|
}
|