You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1014 B

<?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());
}
}