[wp-trac] [WordPress Trac] #35160: Reorganize Feeds Unit Tests & Add Test Coverage for Atom

WordPress Trac noreply at wordpress.org
Thu Jan 14 00:53:08 UTC 2016


#35160: Reorganize Feeds Unit Tests & Add Test Coverage for Atom
----------------------------------------+------------------
 Reporter:  stevenkword                 |       Owner:
     Type:  enhancement                 |      Status:  new
 Priority:  high                        |   Milestone:  4.5
Component:  Feeds                       |     Version:
 Severity:  normal                      |  Resolution:
 Keywords:  has-unit-tests needs-patch  |     Focuses:
----------------------------------------+------------------

Comment (by johnbillion):

 A few notes:

  * The `post_count` and `excerpt_only` properties aren't set in the
 `Tests_Feeds_Atom` class.

 In both `Tests_Feeds_Atom` and `Tests_Feeds_RSS2`:

  * The author assertion needs to test against the user's display name, not
 their `user_login`. Need to explicitly set a display name when creating
 the test user.
  * The test posts should have some categories and tags assigned so the
 category and tag assertions operate on more than just the default category
 and an empty tag list.
  * Creating more than 5 test posts might be a good idea, then an assertion
 can be added to ensure the feeds contain the correct number of posts.
  * Unless the test posts have explicitly differentiating properties (which
 they don't), there's no need to loop over every post and run the
 assertions. Just running the assertions on the first post is enough.
  * `assertCount( 1, $x )` can be used instead of `assertEquals( 1, count(
 $x ) )`.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35160#comment:8>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list