WordPress.org

Make WordPress Core

Opened 5 years ago

Last modified 5 weeks ago

#37096 reviewing enhancement

Unit tests for xmlrpc_getposttitle() and xmlrpc_getpostcategory() along with patch to trim and unique returned values

Reported by: pbearne Owned by: SergeyBiryukov
Milestone: 5.8 Priority: low
Severity: minor Version: 0.71
Component: XML-RPC Keywords: has-patch has-unit-tests dev-feedback
Focuses: Cc:

Description

In tonight's Contrib 2 core we created this unit test for xmlrpc_getposttitle() function

Attachments (5)

xmlrpc-getposttitle.php.patch (3.6 KB) - added by pbearne 5 years ago.
Unit tests
xmlrpc_getpost.patch (9.1 KB) - added by pbearne 5 years ago.
functions.php and unit tests
37096.patch (6.3 KB) - added by pbearne 5 months ago.
updated patch data providers
37096.2.patch (9.9 KB) - added by pbearne 5 months ago.
added xmlrpc_removepostdata
37096.3.patch (11.0 KB) - added by pbearne 5 months ago.
changed xmlrpc_getpostcategory to use the default_category set in options

Download all attachments as: .zip

Change History (24)

@pbearne
5 years ago

Unit tests

#1 @pbearne
5 years ago

these tests just show what is does today

It not very clever and doesn't handle bad data well

If you would nice to update this function but we aren't sure if it worth it

Please ask if you would the function to update

Paul

#2 @DrewAPicture
5 years ago

  • Keywords has-patch has-unit-tests added
  • Version changed from trunk to 0.71

#3 @pbearne
5 years ago

  • Summary changed from Unit tests for xmlrpc_getposttitle() to Unit tests for xmlrpc_getposttitle() and xmlrpc_getpostcategory() along with patch to trim and unique returned values

@pbearne
5 years ago

functions.php and unit tests

#4 @pbearne
5 years ago

Having looked at this a bit more we saw that these function can return values that are not trimmed.

So as well as adding unit tests for xmlrpc_getpostcategory() we have changed the functions to return trimmed values

#5 @desrosj
21 months ago

  • Milestone set to Future Release
  • Owner set to desrosj
  • Priority changed from normal to low
  • Severity changed from normal to minor
  • Status changed from new to reviewing

Hi @pbearne,

Sorry that this ticket fell through the cracks. I am assigning this to myself to review and evaluate.

#6 @pbearne
21 months ago

I had forgotten about this

If it needs a refresh just ask

#7 @desrosj
13 months ago

  • Owner desrosj deleted

#8 @SergeyBiryukov
11 months ago

  • Milestone changed from Future Release to 5.5
  • Owner set to SergeyBiryukov

Related: #49905

#9 @SergeyBiryukov
8 months ago

  • Milestone changed from 5.5 to 5.6

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


5 months ago

#11 @hellofromTonya
5 months ago

Adding the notes from @SergeyBiryukov from today's scrub:

I think these tests could also be converted to use a data provider instead of a bunch of separate functions.
I'll try to refresh and commit before beta or punt otherwise

@pbearne
5 months ago

updated patch data providers

#12 @pbearne
5 months ago

  • Keywords dev-feedback added

Refreshed :-)

#13 @desrosj
5 months ago

Related: #35993.

Looks like #35993 tries to address the two functions here, as well as the xmlrpc_removepostdata() method. There is also some discussion over there and a patch. Just noting so that the approaches can be compared when evaluated.

Would be nice to also address xmlrpc_removepostdata() so that the other ticket can be fully closed out.

@pbearne
5 months ago

added xmlrpc_removepostdata

@pbearne
5 months ago

changed xmlrpc_getpostcategory to use the default_category set in options

#14 @pbearne
5 months ago

OK lets see if that will close both tickets

Note xmlrpc_getpostcategory got some love as well as the tests

#15 @SergeyBiryukov
5 months ago

  • Milestone changed from 5.6 to 5.7

Didn't get a chance to review this in time for 5.6 Beta 1, moving to the next release for now.

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


2 months ago

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


6 weeks ago

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


5 weeks ago

#19 @hellofromTonya
5 weeks ago

  • Milestone changed from 5.7 to 5.8

5.7 Beta 1 is tomorrow. Moving this ticket to 5.8 as there's been no activity since punted from 5.6.

If any maintainer or committer feels this can be resolved in time, or wishes to assume ownership during a specific cycle, feel free to update the milestone accordingly.

Note: See TracTickets for help on using tickets.