public function testGetInput() { $sanity_input = Gas\Janitor::get_input('some_method', array('foo' => 'bar'), TRUE); $this->assertArrayHasKey('foo', $sanity_input); $continue_even_empty = Gas\Janitor::get_input('some_method', array(), FALSE); $this->assertEmpty($continue_even_empty); $this->setExpectedException('InvalidArgumentException', 'empty_arguments:some_method'); Gas\Janitor::get_input('some_method', NULL, TRUE); }
unset($DB); } // Define this root folder as Gas ORM base path defined('GASPATH') or define('GASPATH', __DIR__ . DIRECTORY_SEPARATOR); // Load everything on base gas directory require_once GASPATH . 'classes' . DIRECTORY_SEPARATOR . 'core.php'; require_once GASPATH . 'classes' . DIRECTORY_SEPARATOR . 'data.php'; require_once GASPATH . 'classes' . DIRECTORY_SEPARATOR . 'janitor.php'; require_once GASPATH . 'classes' . DIRECTORY_SEPARATOR . 'orm.php'; require_once GASPATH . 'interfaces' . DIRECTORY_SEPARATOR . 'extension.php'; // Load needed DB files require_once Gas\Janitor::path('base') . 'database' . DIRECTORY_SEPARATOR . 'DB.php'; require_once Gas\Janitor::path('base') . 'database' . DIRECTORY_SEPARATOR . 'DB_forge.php'; require_once Gas\Janitor::path('base') . 'database' . DIRECTORY_SEPARATOR . 'DB_utility.php'; // Define DB path define('DBPATH', Gas\Janitor::path('base') . 'database' . DIRECTORY_SEPARATOR); define('DBDRIVERSPATH', DBPATH . 'drivers' . DIRECTORY_SEPARATOR); // Mock internal CI instance and low-level functions, // in case we run Gas ORM outside CI scope if (!function_exists('get_instance')) { // Build our own TRON! class Tron { /** * @var object Tron super-object */ private static $instance; /** * Constructor * * @param mixed CI DB instance