public function testInvalidDefine() { try { Configuration::define('testinvalid', function () { return null; }); $this->assertTrue(false); } catch (\Exception $e) { $this->assertTrue(true); } }
<?php use Arvici\Heart\Config\Configuration as Configure; /** * Config: app */ Configure::define('app', function ($config) { return ['url' => 'http://localhost:8080', 'env' => 'development', 'log' => true, 'visualException' => true, 'logPath' => BASEPATH . 'logs' . DS, 'logFile' => ['error.log' => \Logger::ERROR, 'development.log' => \Logger::DEBUG], 'timezone' => 'Europe/Amsterdam', 'locale' => 'en', 'private_key' => 'J7a6dhaA&*dhgAfhjkHJv*78gja8gjKg89(*Sf', 'services' => [], 'session' => ['name' => 'arvici_test_session', 'expire' => 1 * 60 * 60, 'path' => '/', 'domain' => null, 'secure' => false, 'http' => true, 'prefix' => 'arvici_'], 'cache' => BASEPATH . 'cache/']; });
<?php use Arvici\Heart\Config\Configuration; use Arvici\Component\View\View; /** * Template Configuration */ Configuration::define('database', function () { return ['fetchType' => \Arvici\Heart\Database\Database::FETCH_ASSOC, 'connections' => ['default' => ['driver' => 'MySQL', 'host' => 'localhost', 'username' => 'root', 'password' => '', 'port' => 3306, 'database' => 'arvici_test'], 'incomplete' => ['driver' => 'MySQL'], 'nodriver' => []]]; });
<?php use Arvici\Heart\Config\Configuration; use Arvici\Component\View\View; /** * Template Configuration */ Configuration::define('template', function () { return ['templatePath' => 'Template/Default', 'viewPath' => 'View', 'defaultStack' => [View::template('header'), View::bodyPlaceholder(), View::template('footer')], 'defaultEngine' => 'PhpTemplate', 'stacks' => ['test-sample' => [View::template('testHeader'), View::bodyPlaceholder(), View::body('testContent'), View::template('testFooter')], 'test-basicrender' => [View::template('testHeader'), View::bodyPlaceholder(), View::template('testFooter')]]]; });
<?php use Arvici\Heart\Config\Configuration as Configure; /** * Config: input */ Configure::define('input', function () { return ['validationSets' => ['testSet' => ['first' => new \Arvici\Heart\Input\Validation\Assert\IntegerType(), 'second' => new \Arvici\Heart\Input\Validation\Assert\Collection([new \Arvici\Heart\Input\Validation\Assert\Required(), new \Arvici\Heart\Input\Validation\Assert\BooleanType()]), 'third' => null, 'fourth' => new \Arvici\Heart\Input\Validation\Assert\Collection([new \Arvici\Heart\Input\Validation\Assert\Alpha(false, false), new \Arvici\Heart\Input\Validation\Assert\Required()])]]]; });
<?php use Arvici\Heart\Config\Configuration as Configure; /** * Config: output */ Configure::define('output', function () { return []; });