/** * @covers ::loadMultiple * @covers ::getEntityTypeFromStaticClass * * Tests Entity::loadMultiple() when called statically on the Entity base * class. */ public function testLoadMultiple() { $this->setupTestLoad(); $storage = $this->getMock('\\Drupal\\Core\\Entity\\EntityStorageInterface'); $storage->expects($this->once())->method('loadMultiple')->with(array(1))->will($this->returnValue(array(1 => $this->entity))); $this->entityManager->expects($this->once())->method('getStorage')->with($this->entityTypeId)->will($this->returnValue($storage)); // Call Entity::loadMultiple statically and check that it returns the mock // entity. $this->assertSame(array(1 => $this->entity), Entity::loadMultiple(array(1))); }