Actually fix view tests

This commit is contained in:
Timothy Warren 2016-01-08 11:40:24 -05:00
parent 557b27ef77
commit 993b625042
4 changed files with 17 additions and 7 deletions

View File

@ -3,6 +3,7 @@
A self-hosted client that allows custom formatting of data from the hummingbird api
[![Build Status](https://jenkins.timshomepage.net/buildStatus/icon?job=animeclient)](https://jenkins.timshomepage.net/job/animeclient/)
[![Build Status](https://travis-ci.org/timw4mail/HummingBirdAnimeClient.svg?branch=master)](https://travis-ci.org/timw4mail/HummingBirdAnimeClient)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/timw4mail/HummingBirdAnimeClient/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/timw4mail/HummingBirdAnimeClient/?branch=master)
[[Hosted Example](https://list.timshomepage.net)]
@ -15,7 +16,7 @@ A self-hosted client that allows custom formatting of data from the hummingbird
* On Hold
* Dropped
* Completed
* All of the above
* Combined View
* Manga List views (Each with list and cover views):
* Reading
@ -23,7 +24,7 @@ A self-hosted client that allows custom formatting of data from the hummingbird
* On Hold
* Dropped
* Completed
* All of the above
* Combined View
* Anime collection view (segmented by media type):
* Cover Images

View File

@ -1,6 +1,6 @@
<?php
include_once __DIR__ . "HttpViewTest.php";
include_once __DIR__ . "/HttpViewTest.php";
class HtmlViewTest extends HttpViewTest {

View File

@ -2,9 +2,9 @@
use Aviat\Ion\Friend;
include_once __DIR__ . "/../ViewTest.php";
include_once __DIR__ . "/HttpViewTest.php";
class JsonViewTest extends ViewTest {
class JsonViewTest extends HttpViewTest {
public function setUp()
{

View File

@ -76,8 +76,6 @@ class TestTransformer extends AbstractTransformer {
}
}
class TestView extends View {}
trait MockViewOutputTrait {
protected function output() {
$reflect = new ReflectionClass($this);
@ -101,6 +99,17 @@ trait MockViewOutputTrait {
}
}
class TestView extends View {
public function send() {}
protected function output()
{
$content =& $this->response->content;
$content->set($this->output);
$content->setType($this->contentType);
$content->setCharset('utf-8');
}
}
class TestHtmlView extends HtmlView {
use MockViewOutputTrait;
}