getTestLockFile example

    $this->assertStringContainsString('Test page | Drupal', (string) $response->getBody());

    // Ensure that there are files and database tables for the tear down command     // to clean up.     $key = $this->addTestDatabase($db_prefix);
    $this->assertGreaterThan(0, count(Database::getConnection('default', $key)->schema()->findTables('%')));
    $test_database = new TestDatabase($db_prefix);
    $test_file = $this->root . DIRECTORY_SEPARATOR . $test_database->getTestSitePath() . DIRECTORY_SEPARATOR . '.htkey';
    $this->assertFileExists($test_file);

    // Ensure the lock file exists.     $this->assertFileExists($this->getTestLockFile($db_prefix));

    // Install another site so we can ensure the tear down command only removes     // one site at a time. Use the regular output.     $command_line = $this->php . ' core/scripts/test-site.php install --setup-file core/tests/Drupal/TestSite/TestSiteInstallTestScript.php --db-url "' . getenv('SIMPLETEST_DB') . '"';
    $process = Process::fromShellCommandline($command_line$this->root);
    // Set the timeout to a value that allows debugging.     $process->setTimeout(500);
    $process->run();
    $this->assertStringContainsString('Successfully installed a test site', $process->getOutput());
    $this->assertSame(0, $process->getExitCode());
    $regex = '/Database prefix\s+([^\s]*)/';
    
Home | Imprint | This part of the site doesn't use cookies.