I noticed in #1935922: Convert PhpStorage tests to phpunit there's a lot of renaming from assertIdentical() in simpletest to assertSame() in PHPUnit.

We should probably rename this function wholesale for better compatibility with PHPUnit.

I think this would also be backportable, assuming it was just a wrapper and we didn't actually remove assertIdentical().

Comments

msonnabaum’s picture

Totally agree. Renaming for d8 and adding an alias method for d7 make ssense.

chx’s picture

What good does it serve if we rename a method to be the same as PHPUnit but the tests are not , isn't that just confusing?

jhodgdon’s picture

Issue summary: View changes

Is this still on the table?

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

imiksu’s picture

Status: Active » Closed (duplicate)
seanb’s picture

Status: Closed (duplicate) » Active

This is not a duplicate as far as I can see. I think this is needed to actually complete the other issue #2756519: Convert assertIdentical() to assertSame() for some uses in kernel tests that already have assertSame()'s parameter order. There is an issue to convert al simpletests to phpunit #2735005: Convert all Simpletest web tests to BrowserTestBase (or UnitTestBase/KernelTestBase), but since it could take some time for all the tests are actually converted, this could help to make the transition go smooth.

  1. First fix this and make sure we can use assertSame() in simpletest. The PHPUnit version checks a lot more as chx points out, but since we want we want to convert everything to PHPUnit anyway, I would still suggest to do this. We could try to make assertSame() works as much as the PHPUnit version as possible. We could also just add assertSame() in stead of renaming assertIdentical().
  2. Fix #2756519: Convert assertIdentical() to assertSame() for some uses in kernel tests that already have assertSame()'s parameter order
  3. Actually convert all the tests to PHPUnit.

For example: some core testbase classes (like EntityWithUriCacheTagsTestBase) still extend simpletest. This is going to be fixed. In the mean time we would like te be able to prepare as much as possible for this change in tests extending the testbases.

Antti J. Salminen’s picture

@seanB: I believe both issues are useful but the other one doesn't depend on this. This issue is about renaming the SimpleTest method and all calls to it to be the same as the one in PHPUnit. #2756519: Convert assertIdentical() to assertSame() for some uses in kernel tests that already have assertSame()'s parameter order is about replacing calls to a wrapper provided by AssertLegacyTrait by direct calls to assertSame() in tests that are already using PHPUnit.

dawehner’s picture

I agree with @seanB, this is not really a duplicate. On the other hand I think we should first finish the process of moving from simpletest to phpunit and then convert all usages of one method to another in one go. Changing simpletest at the same time scatters the effort we do on the other side. Let's focus on one thing, as well, the result will be the same anyway :)

dawehner’s picture

Status: Active » Fixed

Given the process is almost over, I don't think this issue is still worth continueing.

Status: Fixed » Closed (fixed)

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