You are here

protected function MediaBridgeFileTest::await in Open Social 10.1.x

Same name and namespace in other branches
  1. 10.3.x modules/custom/social_graphql/tests/src/Kernel/MediaBridgeFileTest.php \Drupal\Tests\social_graphql\Kernel\MediaBridgeFileTest::await()
  2. 10.0.x modules/custom/social_graphql/tests/src/Kernel/MediaBridgeFileTest.php \Drupal\Tests\social_graphql\Kernel\MediaBridgeFileTest::await()
  3. 10.2.x modules/custom/social_graphql/tests/src/Kernel/MediaBridgeFileTest.php \Drupal\Tests\social_graphql\Kernel\MediaBridgeFileTest::await()

Turns a possible promise into a value.

Parameters

mixed $value: A value that's possible a promise.

Return value

mixed The value or the result of a the promise.

1 call to MediaBridgeFileTest::await()
MediaBridgeFileTest::testImageField in modules/custom/social_graphql/tests/src/Kernel/MediaBridgeFileTest.php
Tests that the MediaBridge class works for Image fields.

File

modules/custom/social_graphql/tests/src/Kernel/MediaBridgeFileTest.php, line 140

Class

MediaBridgeFileTest
Tests that the MediaBridge works with FileItems.

Namespace

Drupal\Tests\social_graphql\Kernel

Code

protected function await($value) {
  if ($value instanceof SyncPromise) {
    $value::runQueue();
    return $value->result;
  }
  return $value;
}