In PHPUnit we can mock abstract classes and any methods we need, and just test the methods implemented on the abstract class.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

damiankloip’s picture

Status: Active » Needs review
FileSize
2.17 KB

And a patch.

Status: Needs review » Needs work
Issue tags: -PHPUnit

The last submitted patch, 2088147.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
Issue tags: +PHPUnit

#1: 2088147.patch queued for re-testing.

ParisLiakos’s picture

  1. +++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
    @@ -0,0 +1,74 @@
    + * @group Drupal
    

    and add @group Lock as well too?

  2. +++ b/core/tests/Drupal/Tests/Core/Lock/LockBackendAbstractTest.php
    @@ -0,0 +1,74 @@
    +  /**
    +   * @var \Drupal\Core\Lock\LockBackendAbstract|\PHPUnit_Framework_MockObject_MockObject
    

    lets add the one liner doc here ;)

damiankloip’s picture

FileSize
2.24 KB
701 bytes

Great, thank you!

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

Status: Reviewed & tested by the community » Needs work
Issue tags: -PHPUnit

The last submitted patch, 2088147-5.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
Issue tags: +PHPUnit

#5: 2088147-5.patch queued for re-testing.

ParisLiakos’s picture

Status: Needs review » Reviewed & tested by the community

and back

catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 8.x, thanks!

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