/** * @dataProvider loadProvider * @param mixed $expected * @param string $id * @param mixed $cache * @param bool $isGet * @param bool $isHead */ public function testLoad($expected, $id, $cache, $isGet, $isHead) { $this->requestMock->expects($this->once())->method('isGet')->will($this->returnValue($isGet)); $this->requestMock->expects($this->any())->method('isHead')->will($this->returnValue($isHead)); $this->cacheMock->expects($this->any())->method('load')->with($this->equalTo($id))->will($this->returnValue(serialize($cache))); $this->identifierMock->expects($this->any())->method('getValue')->will($this->returnValue($id)); $this->assertEquals($expected, $this->kernel->load()); }
/** * */ public function __construct() { self::$s_obj = $this; spl_autoload_register(function ($i_name) { list($ns, $name) = explode('\\', $i_name, 2); if ($ns != __NAMESPACE__) { return; } $name = strtolower($name); if (substr($name, -5) == 'trait') { if (Kernel::load('trait/' . substr($name, 0, -5) . '.php')) { return; } } else { if (substr($name, -4) == 'view') { if (Kernel::load('view/' . substr($name, 0, -4) . '.php')) { return; } } } Kernel::load('model/' . $name . '.php'); }); self::load('inc/global.php'); self::load('inc/db.php'); if (PHP_SAPI == 'cli' && @$_SERVER['argv'][1] == 'install') { self::install_application(); die("done.\n"); } self::initialize(); self::enqueue_std_styles(); self::enqueue_std_scripts(); $this->bootstrap(); }
<?php include_once '../config/config.php'; include_once '../kernel/Kernel.php'; Kernel::load();