Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MockBuilder.php

function MockBuilder::getMockForAbstractClass

Creates a mock object for an abstract class using a fluent interface.

@psalm-return MockObject&MockedType

Throws

Exception

ReflectionException

RuntimeException

Deprecated

https://github.com/sebastianbergmann/phpunit/issues/5305

File

vendor/phpunit/phpunit/src/Framework/MockObject/MockBuilder.php, line 131

Class

MockBuilder
@psalm-template MockedType

Namespace

PHPUnit\Framework\MockObject

Code

public function getMockForAbstractClass() : MockObject {
    $object = $this->generator
        ->mockObjectForAbstractClass($this->type, $this->constructorArgs, $this->mockClassName ?? '', $this->originalConstructor, $this->originalClone, $this->autoload, $this->methods, $this->cloneArguments);
    assert($object instanceof MockObject);
    $this->testCase
        ->registerMockObject($object);
    return $object;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal