50 lines
1014 B
PHP
50 lines
1014 B
PHP
<?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()
|
|
{
|
|
$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());
|
|
}
|
|
}
|