Skip to content

Instantly share code, notes, and snippets.

@adamdicarlo
Created October 15, 2010 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adamdicarlo/627343 to your computer and use it in GitHub Desktop.
Save adamdicarlo/627343 to your computer and use it in GitHub Desktop.
Generates a bunch of test data and inserts it into the simple_payment module's payments table.
#!/usr/bin/php
<?php
require_once './includes/bootstrap.inc';
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
$payment = array(
'gateway' => 'paypal',
'uid' => 0,
'nid' => 1,
'module' => NULL,
'currency' => 'USD',
);
for ($i = 0; $i < 50; $i++) {
$payment['timestamp'] = time() - mt_rand(0, 225000);
$payment['payer_email'] = user_password() . '@opensourcery.com';
$payment['amount'] = mt_rand(50, 25000);
drupal_write_record('simple_payment', $payment);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment