You are here

public function FormStateTest::testLoadIncludeNotFound in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testLoadIncludeNotFound()
  2. 9 core/tests/Drupal/Tests/Core/Form/FormStateTest.php \Drupal\Tests\Core\Form\FormStateTest::testLoadIncludeNotFound()

@covers ::loadInclude

File

core/tests/Drupal/Tests/Core/Form/FormStateTest.php, line 212
Contains \Drupal\Tests\Core\Form\FormStateTest.

Class

FormStateTest
@coversDefaultClass \Drupal\Core\Form\FormState

Namespace

Drupal\Tests\Core\Form

Code

public function testLoadIncludeNotFound() {
  $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(FALSE);
  $this
    ->assertFalse($form_state
    ->loadInclude($module, $type));
}