HummingBirdAnimeClient/tests/AnimeClient/API/ParallelAPIRequestTest.php

49 lines
1.2 KiB
PHP
Raw Normal View History

<?php declare(strict_types=1);
/**
* Hummingbird Anime List Client
*
2018-08-22 13:48:27 -04:00
* An API client for Kitsu to manage anime and manga watch lists
*
2021-02-04 11:57:01 -05:00
* PHP version 8
*
* @package HummingbirdAnimeClient
* @author Timothy J. Warren <tim@timshomepage.net>
2021-01-13 01:52:03 -05:00
* @copyright 2015 - 2021 Timothy J. Warren
* @license http://www.opensource.org/licenses/mit-license.html MIT License
2020-12-10 17:06:50 -05:00
* @version 5.2
* @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient
*/
2017-02-20 13:37:08 -05:00
namespace Aviat\AnimeClient\Tests\API;
2018-01-16 14:58:07 -05:00
use Aviat\AnimeClient\API\ParallelAPIRequest;
2017-02-20 13:37:08 -05:00
use Aviat\Ion\Friend;
use PHPUnit\Framework\TestCase;
2017-02-22 15:08:29 -05:00
class ParallelAPIRequestTest extends TestCase {
2018-01-16 14:58:07 -05:00
2017-02-20 13:37:08 -05:00
public function testAddStringUrlRequest()
{
$requester = new ParallelAPIRequest();
2018-01-16 14:58:07 -05:00
$requester->addRequest('https://httpbin.org');
2017-02-20 13:37:08 -05:00
$friend = new Friend($requester);
2018-01-16 14:58:07 -05:00
2017-02-20 13:37:08 -05:00
$this->assertEquals($friend->requests, ['https://httpbin.org']);
}
2018-01-16 14:58:07 -05:00
2017-02-20 13:37:08 -05:00
public function testAddStringUrlRequests()
{
$requests = [
'foo' => 'http://example.com',
'bar' => 'https://example.com'
];
2018-01-16 14:58:07 -05:00
2017-02-20 13:37:08 -05:00
$requester = new ParallelAPIRequest();
2018-01-16 14:58:07 -05:00
$requester->addRequests($requests);
2017-02-20 13:37:08 -05:00
$friend = new Friend($requester);
2018-01-16 14:58:07 -05:00
2017-02-20 13:37:08 -05:00
$this->assertEquals($friend->requests, $requests);
}
}