PHP code example of alongal / testing-database-loader

1. Go to this page and download the library: Download alongal/testing-database-loader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alongal / testing-database-loader example snippets


    $db = (new \alongal\ImportDb([
            'path_to_mysql_engine' => '/Applications/XAMPP/xamppfiles/bin/mysql',
            'path_to_file_to_load_folder' => realpath(__DIR__ . '/..') . '/tests/',
            'db_name' => 'test_db',
        ]))
            ->setDebugMode(false)
            ->dropDbIfExists(true)
            ->loadFile('test_db_001.sql');