2015-06-26 12:03:42 -04:00
|
|
|
<?php
|
|
|
|
|
2015-09-14 19:54:34 -04:00
|
|
|
use Aviat\AnimeClient\Base\Container;
|
|
|
|
use Aviat\AnimeClient\Base\Model\API as BaseApiModel;
|
2015-06-26 16:39:10 -04:00
|
|
|
|
2015-06-26 12:03:42 -04:00
|
|
|
class MockBaseApiModel extends BaseApiModel {
|
|
|
|
|
2015-09-14 10:54:50 -04:00
|
|
|
public function __construct(Container $container)
|
2015-06-26 12:03:42 -04:00
|
|
|
{
|
2015-09-14 10:54:50 -04:00
|
|
|
parent::__construct($container);
|
2015-06-26 12:03:42 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
public function __get($key)
|
|
|
|
{
|
|
|
|
return $this->$key;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
class BaseApiModelTest extends AnimeClient_TestCase {
|
|
|
|
|
|
|
|
public function testBaseApiModelSanity()
|
|
|
|
{
|
2015-09-14 10:54:50 -04:00
|
|
|
$baseApiModel = new MockBaseApiModel($this->container);
|
2015-06-26 12:03:42 -04:00
|
|
|
|
|
|
|
// Some basic type checks for class memebers
|
2015-09-14 19:54:34 -04:00
|
|
|
$this->assertInstanceOf('\Aviat\AnimeClient\Base\Model', $baseApiModel);
|
|
|
|
$this->assertInstanceOf('\Aviat\AnimeClient\Base\Model\API', $baseApiModel);
|
2015-06-26 12:03:42 -04:00
|
|
|
|
|
|
|
$this->assertInstanceOf('\GuzzleHttp\Client', $baseApiModel->client);
|
|
|
|
$this->assertInstanceOf('\GuzzleHttp\Cookie\CookieJar', $baseApiModel->cookieJar);
|
|
|
|
|
|
|
|
$this->assertTrue(is_string($baseApiModel->base_url));
|
|
|
|
$this->assertTrue(empty($baseApiModel->base_url));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|