Make WordPress Core

Opened 8 years ago

Last modified 2 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's profile pbearne Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: Future Release 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 8 years ago.
Unit tests
xmlrpc_getpost.patch (9.1 KB) - added by pbearne 8 years ago.
functions.php and unit tests
37096.patch (6.3 KB) - added by pbearne 4 years ago.
updated patch data providers
37096.2.patch (9.9 KB) - added by pbearne 4 years ago.
added xmlrpc_removepostdata
37096.3.patch (11.0 KB) - added by pbearne 4 years ago.
changed xmlrpc_getpostcategory to use the default_category set in options

Download all attachments as: .zip

Change History (27)

@pbearne
8 years ago

Unit tests

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

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

#3 @pbearne
8 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
8 years ago

functions.php and unit tests

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

I had forgotten about this

If it needs a refresh just ask

#7 @desrosj
4 years ago

  • Owner desrosj deleted

#8 @SergeyBiryukov
4 years ago

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

Related: #49905

#9 @SergeyBiryukov
4 years ago

  • Milestone changed from 5.5 to 5.6

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


4 years ago

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

updated patch data providers

#12 @pbearne
4 years ago

  • Keywords dev-feedback added

Refreshed :-)

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

added xmlrpc_removepostdata

@pbearne
4 years ago

changed xmlrpc_getpostcategory to use the default_category set in options

#14 @pbearne
4 years ago

OK lets see if that will close both tickets

Note xmlrpc_getpostcategory got some love as well as the tests

#15 @SergeyBiryukov
3 years 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.


3 years ago

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


3 years ago

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


3 years ago

#19 @hellofromTonya
3 years 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.

#20 @SergeyBiryukov
3 years ago

  • Milestone changed from 5.8 to 5.9

#21 @hellofromTonya
2 years ago

  • Milestone changed from 5.9 to Future 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.


2 years ago

Note: See TracTickets for help on using tickets.