PHP code example of magical-yuri / magical-girl

1. Go to this page and download the library: Download magical-yuri/magical-girl 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/ */

    

magical-yuri / magical-girl example snippets


php composer.phar install

    protected static function getExampleHost()
    {
        return '127.0.0.1';
    }
    
    protected static function getExampleUserName()
    {
        return 'user_name';
    }
    
    protected static function getExamplePassword()
    {
        return 'password';
    }

$importer->addRow(
    array('fieldName' => 'value1', 'fieldName' => 'value2'),
    array('fieldName3' => 'ngValue1', 'fieldName4' => 'ngValue2')
);


re_once(__DIR__ . '/../../../../../vendor/magical-girl/magical-girl/tests/MagicalGirl/TableImporter/TableImporterTest.php');

use Tests\MagicalGirl\TableImporter\TableImporterTest;

class MyTableImporterTest extends TableImporterTest
{
    /**
     * getDefaultValues
     * 
     * MagicalGirl will insert these values in these columns.
     *
     * @access protected
     * @see Test\MagicalGirl\TableImporter\TableImporterTest
     */
    protected function getDefaultValues()
    {
        return array('fieldName' => 'value', 'fieldName2' => 'value2');
    }

    /**
     * getNgValues
     *
     * MagicalGirl will never insert these values in these columns.
     *
     * @access protected
     * @see Test\MagicalGirl\TableImporter\TableImporterTest
     */
    protected function getNgValues()
    {
        return array('fieldName' => array('ngValue'));
    }

}

bin/phpunit /path/to/MyTableImporterTest.php