DbDumpApplication example

'user__roles',
      'users',
      'users_field_data',
      'watchdog',
    ];
  }

  /** * Tests the command directly. */
  public function testDbDumpCommand() {
    $application = new DbDumpApplication();
    $command = $application->find('dump-database-d8-mysql');
    $command_tester = new CommandTester($command);
    $command_tester->execute([]);

    // Tables that are schema-only should not have data exported.     $pattern = preg_quote("\$connection->insert('sessions')");
    $this->assertDoesNotMatchRegularExpression('/' . $pattern . '/', $command_tester->getDisplay(), 'Tables defined as schema-only do not have data exported to the script.');

    // Table data is exported.     $pattern = preg_quote("\$connection->insert('config')");
    $this->assertMatchesRegularExpression('/' . $pattern . '/', $command_tester->getDisplay(), 'Table data is properly exported to the script.');

    
if (PHP_SAPI !== 'cli') {
  return;
}

// Bootstrap. $autoloader = require __DIR__ . '/../../autoload.php';
$request = Request::createFromGlobals();
Settings::initialize(dirname(__DIR__, 2), DrupalKernel::findSitePath($request)$autoloader);
DrupalKernel::createFromRequest($request$autoloader, 'prod')->boot();

// Run the database dump command. $application = new DbDumpApplication();
$application->run();
Home | Imprint | This part of the site doesn't use cookies.