Regular Expressions 101

Community Patterns

PHPunit AssertEquals from AssertTrue

1

Regular Expression
PCRE (PHP <7.3)

/
(assertTrue)(.+?)( ==)
/
g

Description

Replaces all occurrences of AssertTrue(a == b); in a file with AssertEquals(a,b), which allows for more information in the test.

Submitted by Chandler Swift - 9 years ago