You are here

public function EntityTypeBundleInfoTest::usesCachedDataWhenAvailable in Entity Construction Kit (ECK) 8

Tests that cached data is used if available.

@test

File

tests/src/Unit/EntityTypeBundleInfoTest.php, line 100

Class

EntityTypeBundleInfoTest
Tests the form element implementation.

Namespace

Drupal\Tests\eck\Unit

Code

public function usesCachedDataWhenAvailable() {
  $this->cacheBackendMock = $this->cacheBackendMock = $this
    ->getMockForAbstractClass(CacheBackendInterface::class);
  $this->cacheBackendMock
    ->expects($this
    ->once())
    ->method('get')
    ->willReturn((object) [
    'data' => 'obviously not normal bundle info',
  ]);
  $sut = $this
    ->createNewTestSubject();
  $this
    ->assertSame('obviously not normal bundle info', $sut
    ->getAllBundleInfo());
}