function UnpackRecipeTest::getFileContents

Gets the contents of a file as an array.

Parameters

string $path: The path to the file.

Return value

array The contents of the file as an array.

14 calls to UnpackRecipeTest::getFileContents()
UnpackRecipeTest::doTestRecipeAUnpacked in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
Tests Recipe A is unpacked correctly.
UnpackRecipeTest::testAutomaticUnpack in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
Tests the dependencies unpack on install.
UnpackRecipeTest::testIgnoreDependentRecipe in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
Tests a dependent recipe can be ignored and not unpacked.
UnpackRecipeTest::testIgnoreRecipe in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
Tests a recipe can be ignored and not unpacked.
UnpackRecipeTest::testNoAutomaticDevUnpack in core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php
Tests the dev dependencies do not unpack on install.

... See full list

File

core/tests/Drupal/Tests/Composer/Plugin/Unpack/Functional/UnpackRecipeTest.php, line 671

Class

UnpackRecipeTest
Tests recipe unpacking.

Namespace

Drupal\Tests\Composer\Plugin\Unpack\Functional

Code

private function getFileContents(string $path) : array {
    $file = file_get_contents($path);
    return json_decode($file, TRUE, flags: JSON_THROW_ON_ERROR);
}

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