function FormStateTest::testLoadIncludeNoName

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

@covers ::loadInclude

File

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

Class

FormStateTest
@coversDefaultClass \Drupal\Core\Form\FormState

Namespace

Drupal\Tests\Core\Form

Code

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

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