Problem/Motivation

As title.

Proposed resolution

Regex for searching: assert.+\(count\(.+\), count\(.+\)(|.+)

Examples:

-    $this->assertEqual(count($options), count($expected_nids));
+    $this->assertCount(count($options), $expected_nids);
-    $this->assertEqual(count($options), count($expected_nids), 'messge');
+    $this->assertCount(count($options), $expected_nids, 'message');

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

jungle created an issue. See original summary.

dww’s picture

Title: Replace assert.+\(count\(.+\), count\(.+\)(|.+) with assertCount() » Replace assertEqual() or assertSame() on two calls to count() with assertCount()

Based on Slack thread with @jungle, giving this a human-readable title.

jungle’s picture

Issue tags: +Novice

Thank you, @dww!

mondrake’s picture

IMHO, in this specific case the current state is better readable than the proposed to-be.

jungle’s picture

Thanks for commenting, @mondrake. Feel free to close this.

dww’s picture

Status: Active » Closed (works as designed)

Yeah, like #3128815: Replace assert*() involving greater/less comparison operators with assert(Greater|Less)Than(OrEqual), I'm also -1 to this specific change. I think the original code is more readable and clear than the proposed replacement.

Seems unanimous, so let's close this.