Download & Extend

TestBase::generatePermutations() should call itself by the proper name in PHPDoc

Project:Drupal core
Version:7.x-dev
Component:documentation
Category:bug report
Priority:minor
Assigned:Unassigned
Status:closed (fixed)
Issue tags:needs backport to D7, Novice

Issue Summary

API page: http://api.drupal.org/api/drupal/core%21modules%21simpletest%21lib%21Dru...

Enter a descriptive title (above) relating to TestBase::generatePermutations, then describe the problem you have found:

In the example code TestBase::permute() is called, when what is meant is the function itself, i.e. TestBase::generatePermutations. This is minor, but still a bit weird.

Comments

#1

Good catch! It looks like the method name was probably changed (there is no permute() method now), and the documentation wasn't updated.

This also applies to the D7 method:
http://api.drupal.org/api/drupal/modules!simpletest!drupal_web_test_case.php/function/DrupalTestCase%3A%3AgeneratePermutations/7

#2

Status:active» needs review

Patch attached.

AttachmentSizeStatusTest resultOperations
1670312-2.patch609 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 37,259 pass(es).View details
7.x-1670312-2.patch555 bytesIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 7.x-1670312-2.patch. Unable to apply patch. See the log in the details link for more information.View details

#3

Status:needs review» needs work

The last submitted patch, 7.x-1670312-2.patch, failed testing.

#4

Status:needs work» reviewed & tested by the community

Looks good. Cool :-)

#5

Status:reviewed & tested by the community» needs work

Oh no, wait, sorry. I just checked, and generatePermutations() is actually a static method. So instead of
$this->generatePermutations($parameters)
we should do
TestBase::generatePermutations($parameters)

#6

Status:needs work» needs review

Patches attached.

AttachmentSizeStatusTest resultOperations
1670312-6.patch612 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 37,259 pass(es).View details
7.x-1670312-6-do-not-test.patch564 bytesIgnored: Check issue status.NoneNone

#7

Project:Drupal core» Documentation
Version:8.x-dev» <none>
Component:documentation» API documentation files
Status:needs review» needs work

Updating project field to Documentation - where the documentation code resides that needs to be patched.

#8

Project:Documentation» Drupal core
Version:<none>» 8.x-dev
Component:API documentation files» documentation

Oops, nevermind this is in the Drupal core code itself. apologies

#9

Status:needs work» reviewed & tested by the community

Very odd... Every place that generatePermutations is actually called in tests, it is called via $this->generatePermutations(), not TestBase::generatePermutations(). But it is a static method... I guess you can call it either way? Anyway, I'll get this committed to 7.x and 8.x.

#10

The commit will probably need to wait until this issue is fixed:
#1541958: Split setUp() into specific sub-methods

#11

Re #9: Yeah, for some reason PHP doesn't throw a fatal on that. Although IIRC it is an E_STRICT on PHP 5.3, but I guess noone runs tests with E_STRICT on 5.3.

#12

I wouldn't say that. When I am developing, I *always* run all my code and tests with E_STRICT. :) But I guess the test bot doesn't. :(

#13

Yes, I do too. But who has the time to run the full suite these days. :-)

#14

Still RTBC, but commit needs to wait on #1541958: Split setUp() into specific sub-methods

#15

Version:8.x-dev» 7.x-dev
Status:reviewed & tested by the community» patch (to be ported)

That issue is back to 7.x, so I committed this patch to 8.x.

This patch now needs a re-roll for 7.x, but the commit to 7.x will need to wait for that issue to be fixed.
#1541958: Split setUp() into specific sub-methods

#16

Status:patch (to be ported)» needs review
AttachmentSizeStatusTest resultOperations
permutations-documentation-1670312-16.patch563 bytesIdlePASSED: [[SimpleTest]]: [MySQL] 39,336 pass(es).View details

#17

Status:needs review» reviewed & tested by the community

Looks good.

#18

Thanks! I'm afraid to commit this until #1563620: All unit tests blow up with a fatal error lands, in case of a conflict... but we'll get it in sometime soon.

#19

Status:reviewed & tested by the community» fixed

I just checked and these two patches do not conflict.

Therefore, committed and pushed to 7.x. Thanks!

#20

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.