Obtains an instance of CodeIgniter gracefully.
Via Composer
$ composer require rougin/spark-plug$ci = Rougin\SparkPlug\Instance::create();
// You can now use its instance
$ci->load->helper('inflector');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.
Please see CHANGELOG for more information what has changed recently.
$ composer testPlease see CONTRIBUTING and CONDUCT for details.
If you discover any security related issues, please email rougingutib@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.