setupTestLoad example

->onlyMethods($methods)
      ->getMock();

  }

  /** * @covers ::load * * Tests Entity::load() when called statically on a subclass of Entity. */
  public function testLoad() {
    $this->setupTestLoad();

    $class_name = get_class($this->entity);

    $entity_type_repository = $this->getMockForAbstractClass(EntityTypeRepositoryInterface::class);
    $entity_type_repository->expects($this->once())
      ->method('getEntityTypeFromClass')
      ->with($class_name)
      ->willReturn($this->entityTypeId);

    $storage = $this->createMock(EntityStorageInterface::class);
    $storage->expects($this->once())
      
Home | Imprint | This part of the site doesn't use cookies.