Skip to content

Commit

Permalink
Make iTunes_Podcast_Helper defines more test friendly
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-xo committed Aug 24, 2022
1 parent a4a39d5 commit d653e6a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 4 additions & 1 deletion dir2cast.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ public function setSelfLink($link)

class iTunes_Podcast_Helper extends GetterSetter implements Podcast_Helper {

static $ITUNES_SUBTITLE_SUFFIX = '';

protected $owner_name, $owner_email, $image_href, $explicit;
protected $categories = array();

Expand Down Expand Up @@ -404,7 +406,7 @@ public function appendToItem(DOMElement $item_element, DOMDocument $doc, RSS_Ite
$itunes_subtitle = $item->getSubtitle();
if($itunes_subtitle !== '')
{
$elements['subtitle'] = $itunes_subtitle . ITUNES_SUBTITLE_SUFFIX;
$elements['subtitle'] = $itunes_subtitle . iTunes_Podcast_Helper::$ITUNES_SUBTITLE_SUFFIX;
}

foreach($elements as $key => $val)
Expand Down Expand Up @@ -1915,6 +1917,7 @@ public static function defaults(array $SERVER)
Dir_Podcast::$DEBUG = DEBUG;
Cached_Dir_Podcast::$MIN_CACHE_TIME = MIN_CACHE_TIME;
getID3_Podcast_Helper::$AUTO_SAVE_COVER_ART = AUTO_SAVE_COVER_ART;
iTunes_Podcast_Helper::$ITUNES_SUBTITLE_SUFFIX = ITUNES_SUBTITLE_SUFFIX;

// Set up up factory settings for RSS Items
RSS_File_Item::$FILES_URL = MP3_URL; // TODO: rename this to MEDIA_URL
Expand Down
2 changes: 1 addition & 1 deletion test/RSS_Item_iTunes_Podcast_HelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function test_rss_item_added_to_podcast_channel_has_itunes_properties()
*/
public function test_rss_item_itunes_subtitle_suffix()
{
define('ITUNES_SUBTITLE_SUFFIX', ' Click here for more…');
iTunes_Podcast_Helper::$ITUNES_SUBTITLE_SUFFIX = ' Click here for more…';

$mp = new MyPodcast();
$helper = new iTunes_Podcast_Helper();
Expand Down
2 changes: 2 additions & 0 deletions test/SettingsHandlerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ public function test_default_defines_set()
$this->assertFalse(getID3_Podcast_Helper::$AUTO_SAVE_COVER_ART);
$this->assertEmpty(RSS_File_Item::$FILES_URL);
$this->assertEmpty(RSS_File_Item::$FILES_DIR);
$this->assertEmpty(iTunes_Podcast_Helper::$ITUNES_SUBTITLE_SUFFIX);
$this->assertFalse(Media_RSS_Item::$LONG_TITLES);
$this->assertEquals('comment', Media_RSS_Item::$DESCRIPTION_SOURCE);

Expand Down Expand Up @@ -191,6 +192,7 @@ public function test_sensible_defaults($argv0)
$this->assertSame(Dir_Podcast::$MIN_FILE_AGE, MIN_FILE_AGE);
$this->assertSame(Cached_Dir_Podcast::$MIN_CACHE_TIME, MIN_CACHE_TIME);
$this->assertSame(getID3_Podcast_Helper::$AUTO_SAVE_COVER_ART, AUTO_SAVE_COVER_ART);
$this->assertSame(iTunes_Podcast_Helper::$ITUNES_SUBTITLE_SUFFIX, ITUNES_SUBTITLE_SUFFIX);
$this->assertSame(RSS_File_Item::$FILES_URL, MP3_URL);
$this->assertSame(RSS_File_Item::$FILES_DIR, MP3_DIR);
$this->assertSame(Media_RSS_Item::$LONG_TITLES, LONG_TITLES);
Expand Down

0 comments on commit d653e6a

Please sign in to comment.