Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of github.com:davorg/xml-feed

  • Loading branch information...
commit aa0b6ff35389c3f9ac3d22d56a6493737084a06e 2 parents f8b9d33 + fb5c190
Dave Cross authored March 12, 2012
6  lib/XML/Feed/Entry/Format/Atom.pm
@@ -145,7 +145,11 @@ sub issued {
145 145
     if (@_) {
146 146
         $entry->{entry}->issued(DateTime::Format::W3CDTF->format_datetime($_[0])) if $_[0];
147 147
     } else {
148  
-        $entry->{entry}->issued ? iso2dt($entry->{entry}->issued) : undef;
  148
+        return iso2dt($entry->{entry}->issued)
  149
+            if $entry->{entry}->issued;
  150
+        return iso2dt($entry->{entry}->published)
  151
+            if $entry->{entry}->published;
  152
+        return undef;
149 153
     }
150 154
 }
151 155
 
12  t/07-atom10-create.t
... ...
@@ -1,8 +1,6 @@
1 1
 use strict;
2 2
 use Test::More;
3 3
 
4  
-plan tests => 17;
5  
-
6 4
 use XML::Feed;
7 5
 use DateTime;
8 6
 
@@ -13,7 +11,7 @@ $feed->title("foo");
13 11
 $feed->description("Atom 1.0 feed");
14 12
 $feed->link("http://example.org/");
15 13
 $feed->id("tag:cpan.org;xml-feed-atom");
16  
-$feed->updated($now);
  14
+$feed->modified($now);
17 15
 
18 16
 my $entry = XML::Feed::Entry->new('Atom');
19 17
 $entry->title("1st Entry");
@@ -21,7 +19,7 @@ $entry->link("http://example.org/");
21 19
 $entry->category("blah");
22 20
 $entry->content("<p>Hello world.</p>");
23 21
 $entry->id("tag:cpan.org;xml-feed-atom-entry");
24  
-$entry->updated($now);
  22
+$entry->modified($now);
25 23
 
26 24
 $feed->add_entry($entry);
27 25
 
@@ -37,7 +35,7 @@ is $feed->title, "foo";
37 35
 is $feed->description, "Atom 1.0 feed";
38 36
 is $feed->link, "http://example.org/";
39 37
 is $feed->id, "tag:cpan.org;xml-feed-atom";
40  
-is "".$feed->updated, "".$now;
  38
+is $feed->modified->iso8601, $now->iso8601;
41 39
 
42 40
 my @entries = $feed->entries;
43 41
 is @entries, 1;
@@ -50,6 +48,6 @@ is $entry->content->type, 'text/html';
50 48
 like $entry->content->body, qr!\s*<p>Hello world.</p>\s*!s;
51 49
 
52 50
 is $entry->id, "tag:cpan.org;xml-feed-atom-entry";
53  
-is "".$entry->updated, "".$now;
54  
-
  51
+is $entry->modified->iso8601, $now->iso8601;
55 52
 
  53
+done_testing();

0 notes on commit aa0b6ff

Please sign in to comment.
Something went wrong with that request. Please try again.