/** * Get a new HttpKernel client instance. * * @param array $server * @return \Symfony\Component\HttpKernel\Client */ public function getClient(array $server = array()) { if (empty($this->app)) { $this->setUp(); } // Setup acl Acl::setup(Config::get('acl::acl')); return new TestClient($this->app, $server); }
/** * A basic functional package test example * * @return void */ public function testBasicPackage() { // Acl package simple test Acl::setup(Config::get('acl::acl')); $this->assertFalse(Acl::isAllowed(array('guest'), 'admin_panel')); $this->assertFalse(Acl::isAllowed(array('user'), 'admin_panel')); $this->assertTrue(Acl::isAllowed(array('admin'), 'admin_panel')); // Here we could test other package facades for its basic functionalities... }
| build a rotating log file setup which creates a new file each day. | */ $logFile = 'log-' . php_sapi_name() . '.txt'; Log::useDailyFiles(storage_path() . '/logs/' . $logFile); /* |-------------------------------------------------------------------------- | Application ACL |-------------------------------------------------------------------------- | | Here we could specify all Access Control List roles and resources | so that, it available across different part of the application | @see config/packages/saas/acl/acl.php */ if (!App::runningInConsole()) { Acl::setup(Config::get('acl::acl')); } /* |-------------------------------------------------------------------------- | Application Logger |-------------------------------------------------------------------------- | | Here we tell the main logger component to start listening to logger events */ if (!App::runningInConsole()) { Logger::startListening(); } /* |-------------------------------------------------------------------------- | Application Error Handler |--------------------------------------------------------------------------