public function testSampleData() { $samples = array('couponcodes', 'custdata', 'departments', 'employees', 'globalvalues', 'houseCoupons', 'houseCouponItems', 'MasterSuperDepts', 'parameters', 'products', 'subdepts', 'tenders'); $dbc = Database::pDataConnect(); foreach ($samples as $sample) { ob_start(); $dbc->query('TRUNCATE TABLE ' . $dbc->identifier_escape($sample)); $loaded = InstallUtilities::loadSampleData($dbc, $sample, false); $output = ob_get_clean(); $this->assertEquals(true, $loaded, 'Error with sample data for ' . $sample . ' (' . $output . ')'); } }
InstallUtilities::loadSampleData($db, 'products'); } elseif (isset($_REQUEST['tenders'])) { echo "Loading tenders"; $db->query("TRUNCATE TABLE tenders"); InstallUtilities::loadSampleData($db, 'tenders'); } elseif (isset($_REQUEST['depts'])) { echo "Loading departments"; $db->query("TRUNCATE TABLE departments"); InstallUtilities::loadSampleData($db, 'departments'); echo "<br />Loading super departments"; $db->query("TRUNCATE TABLE MasterSuperDepts"); InstallUtilities::loadSampleData($db, 'MasterSuperDepts'); } elseif (isset($_REQUEST['quicklookups'])) { echo "Loading QuickLookups"; $db->query("TRUNCATE TABLE QuickLookups"); InstallUtilities::loadSampleData($db, 'QuickLookups'); } ?> </b></div> <p>Some sample data is available to get a test lane up & running quickly. Keep in mind this data overwrites whatever is currently in the table.</p> <hr /> <b>Employees</b> <p>This table contains login information for cashiers. The two included logins are '56' and '7000'.</p> <input id="data" type=submit name=employees value="Load sample employees" /> <hr /> <b>Custdata</b> <p>Customer data is the membership information. Sample data includes a way too many mostly identical lines. A very scrubbed version