Actually fix view tests

This commit is contained in:
Timothy Warren 2016-01-08 11:40:24 -05:00
parent f5549934fe
commit 97dfa89b6d
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 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://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) [![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)] [[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 * On Hold
* Dropped * Dropped
* Completed * Completed
* All of the above * Combined View
* Manga List views (Each with list and cover views): * Manga List views (Each with list and cover views):
* Reading * Reading
@ -23,7 +24,7 @@ A self-hosted client that allows custom formatting of data from the hummingbird
* On Hold * On Hold
* Dropped * Dropped
* Completed * Completed
* All of the above * Combined View
* Anime collection view (segmented by media type): * Anime collection view (segmented by media type):
* Cover Images * Cover Images

View File

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

View File

@ -2,9 +2,9 @@
use Aviat\Ion\Friend; 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() public function setUp()
{ {

View File

@ -76,8 +76,6 @@ class TestTransformer extends AbstractTransformer {
} }
} }
class TestView extends View {}
trait MockViewOutputTrait { trait MockViewOutputTrait {
protected function output() { protected function output() {
$reflect = new ReflectionClass($this); $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 { class TestHtmlView extends HtmlView {
use MockViewOutputTrait; use MockViewOutputTrait;
} }