Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DefaultResultCache.php

function DefaultResultCache::load

Overrides ResultCache::load

File

vendor/phpunit/phpunit/src/Runner/ResultCache/DefaultResultCache.php, line 90

Class

DefaultResultCache
@no-named-arguments Parameter names are not covered by the backward compatibility promise for PHPUnit

Namespace

PHPUnit\Runner\ResultCache

Code

public function load() : void {
    if (!is_file($this->cacheFilename)) {
        return;
    }
    $contents = file_get_contents($this->cacheFilename);
    if ($contents === false) {
        return;
    }
    $data = json_decode($contents, true);
    if ($data === null) {
        return;
    }
    if (!isset($data['version'])) {
        return;
    }
    if ($data['version'] !== self::VERSION) {
        return;
    }
    assert(isset($data['defects']) && is_array($data['defects']));
    assert(isset($data['times']) && is_array($data['times']));
    foreach (array_keys($data['defects']) as $test) {
        $data['defects'][$test] = TestStatus::from($data['defects'][$test]);
    }
    $this->defects = $data['defects'];
    $this->times = $data['times'];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal