From 45e432c8240c53a1b2f3b5843a099f5e8f190e5d Mon Sep 17 00:00:00 2001 From: John Bintz Date: Thu, 11 Feb 2010 18:02:23 -0500 Subject: [PATCH] alt and title methods --- classes/backends/ComicPressBackendFilesystem.inc | 4 ++-- test/backends/ComicPressBackendFilesystemTest.php | 10 ++++++++++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/classes/backends/ComicPressBackendFilesystem.inc b/classes/backends/ComicPressBackendFilesystem.inc index 5f09d4d..79b24b9 100644 --- a/classes/backends/ComicPressBackendFilesystem.inc +++ b/classes/backends/ComicPressBackendFilesystem.inc @@ -29,8 +29,8 @@ class ComicPressBackendFilesystem extends ComicPressBackend { } function file($size = null) { return $this->files_by_type[$this->ensure_type($size)]; } - function alt() {} - function title() {} + function alt() { return $this->alt_text; } + function title() { return $this->title_text; } } class ComicPressBackendFilesystemFactory { diff --git a/test/backends/ComicPressBackendFilesystemTest.php b/test/backends/ComicPressBackendFilesystemTest.php index f1f255b..ad76a8b 100644 --- a/test/backends/ComicPressBackendFilesystemTest.php +++ b/test/backends/ComicPressBackendFilesystemTest.php @@ -67,4 +67,14 @@ class ComicPressBackendFilesystemTest extends PHPUnit_Framework_TestCase { $this->assertEquals('file', $fs->file('type')); } + + function testAlt() { + $this->fs->alt_text = 'text'; + $this->assertEquals('text', $this->fs->alt()); + } + + function testTitle() { + $this->fs->title_text = 'text'; + $this->assertEquals('text', $this->fs->title()); + } }