2017-02-20 13:37:08 -05:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\Tests\API;
|
|
|
|
|
|
|
|
use Aviat\AnimeClient\API\{APIRequestBuilder, ParallelAPIRequest};
|
|
|
|
use Aviat\Ion\Friend;
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
|
2017-02-22 15:08:29 -05:00
|
|
|
class ParallelAPIRequestTest extends TestCase {
|
2017-02-20 13:37:08 -05:00
|
|
|
|
|
|
|
public function testAddStringUrlRequest()
|
|
|
|
{
|
|
|
|
$requester = new ParallelAPIRequest();
|
|
|
|
$friend = new Friend($requester);
|
|
|
|
$friend->addRequest('https://httpbin.org');
|
|
|
|
|
|
|
|
$this->assertEquals($friend->requests, ['https://httpbin.org']);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testAddStringUrlRequests()
|
|
|
|
{
|
|
|
|
$requests = [
|
|
|
|
'foo' => 'http://example.com',
|
|
|
|
'bar' => 'https://example.com'
|
|
|
|
];
|
|
|
|
|
|
|
|
$requester = new ParallelAPIRequest();
|
|
|
|
$friend = new Friend($requester);
|
|
|
|
$friend->addRequests($requests);
|
|
|
|
|
|
|
|
$this->assertEquals($friend->requests, $requests);
|
|
|
|
}
|
|
|
|
}
|