You are here

protected function MediaBridgeMediaTest::setUp in Open Social 10.2.x

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

Overrides MediaKernelTestBase::setUp

File

modules/custom/social_graphql/tests/src/Kernel/MediaBridgeMediaTest.php, line 39

Class

MediaBridgeMediaTest
Tests that the MediaBridge works with Media entities.

Namespace

Drupal\Tests\social_graphql\Kernel

Code

protected function setUp() {
  parent::setUp();

  // Create a test image.
  \Drupal::service('file_system')
    ->copy($this->root . '/core/misc/druplicon.png', 'public://social_graphql-example-2.jpg');
  $this->image = File::create([
    'uri' => 'public://social_graphql-example-2.jpg',
  ]);
  $this->image
    ->save();

  // Ensure we can access our data provider.
  $this->dataProducerPluginManager = $this->container
    ->get('plugin.manager.graphql.data_producer');
}