function EntityTypeBundleInfoTest::testGetBundleInfoWithNull

Tests calling getBundleInfo() method with a NULL.

Attributes

#[IgnoreDeprecations]

File

core/tests/Drupal/Tests/Core/Entity/EntityTypeBundleInfoTest.php, line 351

Class

EntityTypeBundleInfoTest
Tests Drupal\Core\Entity\EntityTypeBundleInfo.

Namespace

Drupal\Tests\Core\Entity

Code

public function testGetBundleInfoWithNull() : void {
  $this->expectUserDeprecationMessage('Calling Drupal\\Core\\Entity\\EntityTypeBundleInfo::getBundleInfo() with a non-string $entity_type_id is deprecated in drupal:11.3.0 and throws an exception in drupal:12.0.0. See https://www.drupal.org/node/3557136');
  $bundle_info = $this->entityTypeBundleInfo
    ->getBundleInfo(NULL);
  $this->assertSame([], $bundle_info);
}

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