Chris@0: randomMachineName()); Chris@0: $this->assertNotNull($file_name); Chris@0: Chris@0: // During testing the file change and the stale checking occurs in the same Chris@0: // request, so the beginning of request will be before the file changes and Chris@0: // REQUEST_TIME - $filectime is negative. Set the maximum age to a number Chris@0: // even smaller than that. Chris@0: $this->config('system.file') Chris@0: ->set('temporary_maximum_age', -100000) Chris@0: ->save(); Chris@0: Chris@14: $file_path = \Drupal::service('file_system')->realpath($file_name); Chris@0: update_delete_file_if_stale($file_path); Chris@0: Chris@0: $this->assertFalse(is_file($file_path)); Chris@0: } Chris@0: Chris@0: }