Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#31705 closed defect (bug) (fixed)

Tests_Feed_RSS2::test_items errors with Undefined index: content

Reported by: ianmjones's profile ianmjones Owned by:
Milestone: 4.2 Priority: normal
Severity: normal Version: 4.2
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

When running the current Unit Tests, there is an error.

There was 1 error:

1) Tests_Feed_RSS2::test_items
Undefined index: content

/Users/ian/Dropbox/Websites/wordpress-core/tests/phpunit/tests/feed/rss2.php:120

On investigation it turns out that the posts generated in the Tests_Feed_RSS2::setUp() do not have authors properly defined and therefore the <dc:creator> elements of the feed have no content.

I have a patch for the unit tests.

Attachments (1)

31705.patch (558 bytes) - added by ianmjones 9 years ago.

Download all attachments as: .zip

Change History (8)

@ianmjones
9 years ago

#1 @ianmjones
9 years ago

  • Keywords has-patch added

This ticket was mentioned in Slack in #core by ianmjones. View the logs.


9 years ago

#3 @boonebgorges
9 years ago

  • Milestone changed from Awaiting Review to 4.2

Thanks for the report! In my tests, I'm not able to reproduce the PHP notice - the 'content' index is defined, but it's an empty string - but you are quite correct that the posts should have an author, otherwise the assertEquals() assertions don't mean much.

#4 @boonebgorges
9 years ago

In 31845:

Ensure that fixtures in RSS2 tests have an author.

This makes the 'dc:creator' assertions more meaningful.

Props ianmjones.
See #31705.

#5 @boonebgorges
9 years ago

In 31846:

Enforce non-pretty permalinks in RSS2 tests.

Previously, the tests were using '/feed/' in their go_to() statements, but
testing nodes for URLs like '?p='. This mismatch created unpredictable results
when the run in certain sequences with other groups of unit tests.

See #31705.

#6 @boonebgorges
9 years ago

In 31848:

Use shared fixtures in RSS2 unit tests.

See #31705, #30017.

#7 @boonebgorges
9 years ago

  • Resolution set to fixed
  • Status changed from new to closed

I used this ticket for a little extra cleanup in those tests. Thanks again for the report.

Note: See TracTickets for help on using tickets.