Make WordPress Core

Opened 10 years ago

Last modified 5 years 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
Priority: low Milestone: Future Release
Component: XML-RPC Version: 0.71
Severity: minor Keywords: has-patch has-unit-tests dev-feedback
Cc: Focuses:

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 10 years ago.
Unit tests
xmlrpc_getpost.patch (9.1 KB ) - added by pbearne 10 years ago.
functions.php and unit tests
37096.patch (6.3 KB ) - added by pbearne 6 years ago.
updated patch data providers
37096.2.patch (9.9 KB ) - added by pbearne 6 years ago.
added xmlrpc_removepostdata
37096.3.patch (11.0 KB ) - added by pbearne 6 years ago.
changed xmlrpc_getpostcategory to use the default_category set in options

Download all attachments as: .zip

Change History (27)

@pbearne
10 years ago

Unit tests

#1 @pbearne
10 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
10 years ago

  • Keywords has-patch has-unit-tests added
  • Version trunk0.71

#3 @pbearne
10 years ago

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

@pbearne
10 years ago

functions.php and unit tests

#4 @pbearne
10 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
7 years ago

  • MilestoneFuture Release
  • Owner set to desrosj
  • Priority normallow
  • Severity normalminor
  • Status newreviewing

Hi @pbearne,

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

#6 @pbearne
7 years ago

I had forgotten about this

If it needs a refresh just ask

#7 @desrosj
7 years ago

  • Owner desrosj removed

#8 @SergeyBiryukov
6 years ago

  • Milestone Future Release5.5
  • Owner set to SergeyBiryukov

Related: #49905

#9 @SergeyBiryukov
6 years ago

  • Milestone 5.55.6

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


6 years ago

#11 @hellofromTonya
6 years 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
6 years ago

updated patch data providers

#12 @pbearne
6 years ago

  • Keywords dev-feedback added

Refreshed :-)

#13 @desrosj
6 years 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
6 years ago

added xmlrpc_removepostdata

@pbearne
6 years ago

changed xmlrpc_getpostcategory to use the default_category set in options

#14 @pbearne
6 years ago

OK lets see if that will close both tickets

Note xmlrpc_getpostcategory got some love as well as the tests

#15 @SergeyBiryukov
6 years ago

  • Milestone 5.65.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.


6 years ago

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


6 years ago

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


6 years ago

#19 @hellofromTonya
6 years ago

  • Milestone 5.75.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.

#20 @SergeyBiryukov
5 years ago

  • Milestone 5.85.9

#21 @hellofromTonya
5 years ago

  • Milestone 5.9Future Release

As of yesterday, 5.9 is now in Feature Freeze.

Tests are not bound to a release cycle and can be committed into trunk at any point. As there's been no activity for 13 months (other than punting), moving to Future Release. When it's ready, please move into the milestone.

This ticket was mentioned in Slack in #core-test by pbearne. View the logs.


5 years ago

Note: See TracTickets for help on using tickets.