You are here

public function TextareaWidgetTest::testIsApplicable in Typed Data API enhancements 8

@covers ::isApplicable

Overrides FormWidgetBrowserTestBase::testIsApplicable

File

tests/src/Functional/TypedDataFormWidget/TextareaWidgetTest.php, line 37

Class

TextareaWidgetTest
Class TextInputWidgetTest.

Namespace

Drupal\Tests\typed_data\Functional\TypedDataFormWidget

Code

public function testIsApplicable() {
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('any')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('binary')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('boolean')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('datetime_iso8601')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('duration_iso8601')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('email')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('float')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('integer')));
  $this
    ->assertTrue($this->widget
    ->isApplicable(DataDefinition::create('string')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('timespan')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('timestamp')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(DataDefinition::create('uri')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(ListDataDefinition::create('string')));
  $this
    ->assertFalse($this->widget
    ->isApplicable(MapDataDefinition::create()));
}