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

Breadcrumb

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

function DefaultResultCache::persist

Throws

Exception

Overrides ResultCache::persist

File

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

Class

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

Namespace

PHPUnit\Runner\ResultCache

Code

public function persist() : void {
    if (!Filesystem::createDirectory(dirname($this->cacheFilename))) {
        throw new DirectoryDoesNotExistException(dirname($this->cacheFilename));
    }
    $data = [
        'version' => self::VERSION,
        'defects' => [],
        'times' => $this->times,
    ];
    foreach ($this->defects as $test => $status) {
        $data['defects'][$test] = $status->asInt();
    }
    file_put_contents($this->cacheFilename, json_encode($data), LOCK_EX);
}

API Navigation

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