Skip to content

coldlamper/spark-plug

 
 

Repository files navigation

Spark Plug

Latest Version on Packagist Software License Build Status Coverage Status Quality Score Total Downloads

Obtains an instance of CodeIgniter gracefully.

Install

Via Composer

$ composer require rougin/spark-plug

Usage

Basic Usage

$ci = Rougin\SparkPlug\Instance::create();

// You can now use its instance
$ci->load->helper('inflector');

As a mock instance for unit testing

class SparkPlugTest extends \PHPUnit_Framework_TestCase
{
    /**
     * Checks if the CodeIgniter instance is successfully retrieved.
     * 
     * @return void
     */
    public function testCodeIgniterInstance()
    {
        // Path of your test application
        $appPath = __DIR__ . '/TestApp';

        // Instance::create($appPath, $_SERVER, $GLOBALS)
        $ci = \Rougin\SparkPlug\Instance::create($appPath);

        $this->assertInstanceOf('CI_Controller', $ci);
    }
}

NOTE: To create a mock instance, a rougin/codeigniter package and a test application directory are required. Kindly check the tests directory for more examples.

Change Log

Please see CHANGELOG for more information what has changed recently.

Testing

$ composer test

Contributing

Please see CONTRIBUTING and CONDUCT for details.

Security

If you discover any security related issues, please email rougingutib@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

Obtains an instance of CodeIgniter gracefully

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • PHP 99.4%
  • HTML 0.6%