2017-01-27 15:41:52 -05:00
|
|
|
<?php declare(strict_types=1);
|
2017-02-07 13:27:41 -05:00
|
|
|
/**
|
2017-02-15 16:13:32 -05:00
|
|
|
* Hummingbird Anime List Client
|
2017-02-07 13:27:41 -05:00
|
|
|
*
|
|
|
|
* An API client for Kitsu and MyAnimeList to manage anime and manga watch lists
|
|
|
|
*
|
|
|
|
* PHP version 7
|
|
|
|
*
|
2017-02-15 16:13:32 -05:00
|
|
|
* @package HummingbirdAnimeClient
|
2017-02-07 13:27:41 -05:00
|
|
|
* @author Timothy J. Warren <tim@timshomepage.net>
|
|
|
|
* @copyright 2015 - 2017 Timothy J. Warren
|
|
|
|
* @license http://www.opensource.org/licenses/mit-license.html MIT License
|
|
|
|
* @version 4.0
|
|
|
|
* @link https://github.com/timw4mail/HummingBirdAnimeClient
|
|
|
|
*/
|
2017-01-27 15:41:52 -05:00
|
|
|
|
|
|
|
namespace Aviat\AnimeClient\Tests\API;
|
|
|
|
|
|
|
|
use Aviat\AnimeClient\API\CacheTrait;
|
2017-02-15 16:40:18 -05:00
|
|
|
use Aviat\AnimeClient\Tests\AnimeClientTestCase;
|
2017-01-27 15:41:52 -05:00
|
|
|
|
2017-02-15 16:40:18 -05:00
|
|
|
class CacheTraitTest extends AnimeClientTestCase {
|
2017-01-27 15:41:52 -05:00
|
|
|
public function setUp()
|
|
|
|
{
|
|
|
|
parent::setUp();
|
|
|
|
$this->testClass = new class {
|
|
|
|
use CacheTrait;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testSetGet()
|
|
|
|
{
|
|
|
|
$cachePool = $this->container->get('cache');
|
|
|
|
$this->testClass->setCache($cachePool);
|
|
|
|
$this->assertEquals($cachePool, $this->testClass->getCache());
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testGetHashForMethodCall()
|
|
|
|
{
|
|
|
|
$hash = $this->testClass->getHashForMethodCall($this, __METHOD__, []);
|
|
|
|
$this->assertEquals('684ba0a5c29ffec452c5f6a07d2eee6932575490', $hash);
|
|
|
|
}
|
|
|
|
}
|