WordPress.org

Make WordPress Core

Opened 8 days ago

Closed 8 days ago

#46500 closed enhancement (fixed)

Performs minor code improvements in abstract-testcase.php

Reported by: andizer Owned by: SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: trunk
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:

Description

I've done some minor code improvements to make the code in abstract-testcase a little bit better:

  • Added TRUE as third argument for in_array checks
  • Used strpos instead of substr where possible
  • Add value directly to array by key instead of array_push
  • Removed an else statement because the if already returns a value.

I hope these changes are desirable. I would love to hear this, because I can continue performing equal changes elsewhere in the testing framework.

Attachments (1)

46500.diff (4.9 KB) - added by andizer 8 days ago.

Download all attachments as: .zip

Change History (3)

@andizer
8 days ago

#1 @SergeyBiryukov
8 days ago

  • Milestone changed from Awaiting Review to 5.2
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 @SergeyBiryukov
8 days ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 44916:

Coding Standards: Minor code and performance improvements in phpunit/includes/abstract-testcase.php.

Props andizer.
Fixes #46500.

Note: See TracTickets for help on using tickets.