✅ Ajoute des tests
This commit is contained in:
parent
f7b6573375
commit
53d81b98fc
@ -5,6 +5,9 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"fabpot/goutte": "^3.1"
|
"fabpot/goutte": "^3.1"
|
||||||
},
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"phpunit/phpunit": "^5.7"
|
||||||
|
},
|
||||||
"authors": [
|
"authors": [
|
||||||
{
|
{
|
||||||
"name": "Shikiryu",
|
"name": "Shikiryu",
|
||||||
|
7
phpunit.xml
Normal file
7
phpunit.xml
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<phpunit bootstrap="vendor/autoload.php">
|
||||||
|
<testsuites>
|
||||||
|
<testsuite name="api">
|
||||||
|
<directory>tests</directory>
|
||||||
|
</testsuite>
|
||||||
|
</testsuites>
|
||||||
|
</phpunit>
|
33
tests/AccountTest.php
Normal file
33
tests/AccountTest.php
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
<?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 testAdd()
|
||||||
|
{
|
||||||
|
$result = $this->account->getConfig();
|
||||||
|
$this->assertInstanceOf( \Shikiryu\LBCReposter\Config::class, $result );
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user