You are here

public function EntityDisplayBaseTest::testSetTargetBundle in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php \Drupal\Tests\Core\Config\Entity\EntityDisplayBaseTest::testSetTargetBundle()
  2. 10 core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php \Drupal\Tests\Core\Config\Entity\EntityDisplayBaseTest::testSetTargetBundle()

@covers ::setTargetBundle

File

core/tests/Drupal/Tests/Core/Config/Entity/EntityDisplayBaseTest.php, line 61

Class

EntityDisplayBaseTest
@coversDefaultClass \Drupal\Core\Entity\EntityDisplayBase

Namespace

Drupal\Tests\Core\Config\Entity

Code

public function testSetTargetBundle() {
  $mock = $this
    ->getMockForAbstractClass('\\Drupal\\Core\\Entity\\EntityDisplayBase', [], '', FALSE);
  $reflection = new \ReflectionProperty($mock, 'bundle');
  $reflection
    ->setAccessible(TRUE);
  $mock
    ->setTargetBundle('test');
  $this
    ->assertEquals('test', $reflection
    ->getValue($mock));
}