function SimpletestDeprecationTest::testDeprecatedSimpletestGenerateFile

@expectedDeprecation simpletest_generate_file() is deprecated in drupal:8.8.0 and is removed from drupal:9.0.0. Use \Drupal\Tests\TestFileCreationTrait::generateFile() instead. See https://www.drupal.org/node/3077768

File

core/modules/simpletest/tests/src/Kernel/SimpletestDeprecationTest.php, line 88

Class

SimpletestDeprecationTest
Verify deprecations within the simpletest module.

Namespace

Drupal\Tests\simpletest\Kernel

Code

public function testDeprecatedSimpletestGenerateFile() {
    $file = simpletest_generate_file('foo', 40, 10);
    $public_file = 'public://' . $file . '.txt';
    $this->assertFileExists($public_file);
    $this->assertTrue(unlink($public_file));
}

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