function FormStateTest::testLoadInclude

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

@covers ::loadInclude

File

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

Class

FormStateTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Form%21FormState.php/class/FormState/11.x" title="Stores information about the state of a form." class="local">\Drupal\Core\Form\FormState</a>

Namespace

Drupal\Tests\Core\Form

Code

public function testLoadInclude() : void {
    $type = 'some_type';
    $module = 'some_module';
    $name = 'some_name';
    $form_state = $this->getMockBuilder('Drupal\\Core\\Form\\FormState')
        ->onlyMethods([
        'moduleLoadInclude',
    ])
        ->getMock();
    $form_state->expects($this->once())
        ->method('moduleLoadInclude')
        ->with($module, $type, $name)
        ->willReturn(TRUE);
    $this->assertTrue($form_state->loadInclude($module, $type, $name));
}

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