function FormStateTest::testLoadIncludeAlreadyLoaded

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testLoadIncludeAlreadyLoaded()
  2. 8.9.x core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testLoadIncludeAlreadyLoaded()
  3. 11.x core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testLoadIncludeAlreadyLoaded()

@covers ::loadInclude

File

core/tests/Drupal/Tests/Core/Form/FormStateTest.php, line 225

Class

FormStateTest
@coversDefaultClass \Drupal\Core\Form\FormState[[api-linebreak]]

Namespace

Drupal\Tests\Core\Form

Code

public function testLoadIncludeAlreadyLoaded() : void {
  $type = 'some_type';
  $module = 'some_module';
  $name = 'some_name';
  $form_state = $this->getMockBuilder('Drupal\\Core\\Form\\FormState')
    ->onlyMethods([
    'moduleLoadInclude',
  ])
    ->getMock();
  $form_state->addBuildInfo('files', [
    'some_module:some_name.some_type' => [
      'type' => $type,
      'module' => $module,
      'name' => $name,
    ],
  ]);
  $form_state->expects($this->never())
    ->method('moduleLoadInclude');
  $this->assertFalse($form_state->loadInclude($module, $type, $name));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.