From ca402bd82667798f8d0b3fb82ec618345da40aab Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Fri, 31 Mar 2017 14:15:29 -0400 Subject: [PATCH] Add favorite characters to user page, see #27 --- app/views/me.php | 47 ++++++++++++++++++++++++++++++++--- tests/ControllerTest.php | 29 ++++----------------- tests/ControllerTraitTest.php | 39 ----------------------------- tests/DispatcherTest.php | 2 ++ 4 files changed, 50 insertions(+), 67 deletions(-) delete mode 100644 tests/ControllerTraitTest.php diff --git a/app/views/me.php b/app/views/me.php index 47434cc1..fc08198b 100644 --- a/app/views/me.php +++ b/app/views/me.php @@ -6,6 +6,9 @@

+ + + @@ -18,7 +21,7 @@ + + + + + + + + + + + + + + +
General
Location
html($attributes['waifuOrHusbando']) ?> - a( $url->generate('character', ['slug' => $character['slug']]), @@ -28,6 +31,21 @@
User Stats
# of Posts
# of Comments
# of Media Rated
@@ -35,9 +53,30 @@
About:
html($attributes['bio']) ?>
- -
-
*/ ?> + +

Favorites:

+ +
+

Characters

+
+ + +
+ generate('character', ['slug' => $char['slug']]) ?> + a($link, $char['name']); ?> +
+ + img($char['image']['original'], [ + 'width' => '225' + ]) ?> + +
+ + +
+
+ +
\ No newline at end of file diff --git a/tests/ControllerTest.php b/tests/ControllerTest.php index 57ba8dee..2215b1e2 100644 --- a/tests/ControllerTest.php +++ b/tests/ControllerTest.php @@ -80,31 +80,12 @@ class ControllerTest extends AnimeClientTestCase { $this->assertTrue(is_object($this->BaseController)); } - public function dataGet() + public function testFormatTitle() { - return [ - 'response' => [ - 'key' => 'response', - ], - 'config' => [ - 'key' => 'config', - ] - ]; - } - - /** - * @dataProvider dataGet - */ - public function testGet($key) - { - $result = $this->BaseController->__get($key); - $this->assertEquals($this->container->get($key), $result); - } - - public function testGetNull() - { - $result = $this->BaseController->__get('foo'); - $this->assertNull($result); + $this->assertEquals( + $this->BaseController->formatTitle('foo', 'bar', 'baz'), + 'foo · bar · baz' + ); } } \ No newline at end of file diff --git a/tests/ControllerTraitTest.php b/tests/ControllerTraitTest.php deleted file mode 100644 index 256acafd..00000000 --- a/tests/ControllerTraitTest.php +++ /dev/null @@ -1,39 +0,0 @@ - - * @copyright 2015 - 2017 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 4.0 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\Tests; - -use Aviat\AnimeClient\ControllerTrait; - -class ControllerTraitTest extends AnimeClientTestCase { - - public function setUp() - { - parent::setUp(); - - $this->controller = new class { - use ControllerTrait; - }; - } - - public function testFormatTitle() - { - $this->assertEquals( - $this->controller->formatTitle('foo', 'bar', 'baz'), - 'foo · bar · baz' - ); - } -} \ No newline at end of file diff --git a/tests/DispatcherTest.php b/tests/DispatcherTest.php index e2613a45..ce1e3f1a 100644 --- a/tests/DispatcherTest.php +++ b/tests/DispatcherTest.php @@ -229,6 +229,7 @@ class DispatcherTest extends AnimeClientTestCase { 'manga' => 'Aviat\AnimeClient\Controller\Manga', 'collection' => 'Aviat\AnimeClient\Controller\Collection', 'character' => 'Aviat\AnimeClient\Controller\Character', + 'index' => 'Aviat\AnimeClient\Controller\Index', ] ], 'empty_controller_list' => [ @@ -249,6 +250,7 @@ class DispatcherTest extends AnimeClientTestCase { 'manga' => 'Aviat\AnimeClient\Controller\Manga', 'collection' => 'Aviat\AnimeClient\Controller\Collection', 'character' => 'Aviat\AnimeClient\Controller\Character', + 'index' => 'Aviat\AnimeClient\Controller\Index', ] ] ];