protected function setUp() { $_SERVER["SERVER_NAME"] = 'localhost'; $this->app = __setupApp(); if (empty($_GET['_url'])) { $_GET['_url'] = ''; } }
public function testCreateNewFile2() { $app = __setupApp(); $console = new Console($app, true); $console->addCommands($app->config('additionalCommands')); /** * @var SkullyAwsS3\S3Client $s3client * @var SkullyAwsS3\S3ApplicationTrait $app */ $s3client = $app->getS3Client(); $this->assertTrue($s3client->isObject('text.txt')); $this->assertFalse($s3client->isObject('TestApp/appfile.txt')); }
public function testPackCommand() { $app = __setupApp(); $console = new Console($app, true); $packedPath = FileHelper::replaceSeparators(realpath(__DIR__ . '/packerTest/packed.js')); if (file_exists($packedPath)) { unlink($packedPath); } $this->assertFalse(file_exists($packedPath)); ob_get_clean(); ob_start(); $output = $console->run("skully:pack Commands/packerTest/packerTest.txt"); // Cannot test this on Windows somehow, so just check if pack command is running. $this->assertNotEmpty($output); }
protected function setUp() { $config = new Config(); $config->setProtected('basePath', BASE_PATH); setCommonConfig($config); setUniqueConfig($config); Application::setupRedBean('sqlite:test.db', 'user', 'password', $this->frozen, 'sqlite'); R::freeze(false); R::nuke(); R::freeze($this->frozen); $this->app = __setupApp(); /** $http Mock Http object. */ $http = $this->getMock('Skully\\Core\\Http'); $http->expects($this->any())->method('redirect')->will($this->returnCallback('stubRedirect')); $this->app->setHttp($http); }
protected function setUp() { $config = new Config(); $config->setProtected('basePath', BASE_PATH); setCommonConfig($config); setUniqueConfig($config); $dbConfig = $config->getProtected('dbConfig'); if ($dbConfig['type'] == 'mysql') { Application::setupRedBean("mysql:host={$dbConfig['host']};dbname={$dbConfig['dbname']};port={$dbConfig['port']}", $dbConfig['user'], $dbConfig['password'], $config->getProtected('isDevMode')); } elseif ($dbConfig['type'] == 'sqlite') { Application::setupRedBean("sqlite:{$dbConfig['dbname']}", $dbConfig['user'], $dbConfig['password'], $config->getProtected('isDevMode')); } R::freeze(false); R::nuke(); R::freeze($this->frozen); $this->app = __setupApp(); /** $http Mock Http object. */ $http = $this->getMock('Skully\\Core\\Http'); $http->expects($this->any())->method('redirect')->will($this->returnCallback('stubRedirect')); $this->app->setHttp($http); }
public function up() { $app = __setupApp(); $setting = $app->createModel('setting', array('name' => 'smtpSecurity', 'description' => 'SMTP Security. ssl (default) or tls', 'type' => 'string', 'input_type' => 'text', 'value' => 'ssl', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'smtpPort', 'description' => "SMTP port (default: 465)", 'value' => '465', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'smtpHost', 'description' => 'SMTP host', 'value' => 'heroic.hostingheroes.net', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'smtpPassword', 'description' => 'Contact SMTP password', 'value' => '48z.,*WnrN}', 'is_visible' => true, 'is_client' => false, 'type' => 'string', 'input_type' => 'password')); R::store($setting); $setting = $app->createModel('setting', array('name' => 'smtpUsername', 'description' => 'SMTP username', 'value' => '*****@*****.**', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'senderEmail', 'description' => 'Sender Email', 'value' => '*****@*****.**', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'senderName', 'description' => 'Contact Sender Name', 'value' => 'No Reply', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'replyToEmail', 'description' => 'Reply-to Email', 'value' => '*****@*****.**', 'is_visible' => true, 'is_client' => false)); R::store($setting); $setting = $app->createModel('setting', array('name' => 'replyToName', 'description' => 'Reply-to Name', 'value' => 'Your Name', 'is_visible' => true, 'is_client' => false)); R::store($setting); }
public function up() { $t = $this->create_table('image', array('options' => 'Engine=InnoDB collate=utf8_unicode_ci')); $t->column('multiple_many_types', 'text'); $t->column('multiple_one_type', 'text'); $t->column('single_many_types', 'text'); $t->column('single_one_type', 'text'); $t->column('position', 'integer'); $t->finish(); $app = __setupApp(); $setting = $app->createModel('setting', array('name' => 'multiple_many_types', 'description' => 'Sample Multiple Many Types Setting Image', 'type' => 'string', 'is_visible' => false, 'is_client' => false)); R::store($setting); $app = __setupApp(); $setting = $app->createModel('setting', array('name' => 'multiple_one_type', 'description' => 'Sample Multiple One Type Setting Image', 'type' => 'string', 'is_visible' => false, 'is_client' => false)); R::store($setting); $app = __setupApp(); $setting = $app->createModel('setting', array('name' => 'single_many_types', 'description' => 'Sample Single Many Types Setting Image', 'type' => 'string', 'is_visible' => false, 'is_client' => false)); R::store($setting); $app = __setupApp(); $setting = $app->createModel('setting', array('name' => 'single_one_type', 'description' => 'Sample Single One Type Setting Image', 'type' => 'string', 'is_visible' => false, 'is_client' => false)); R::store($setting); }
/** * This method tests all views within this app, ensuring no error was found. */ public function testAllViews() { $app = __setupApp(); /** $http Mock Http object. */ $http = $this->getMock('Skully\\Core\\Http'); $http->expects($this->any())->method('redirect')->will($this->returnCallback('stubRedirect')); $app->setHttp($http); foreach (new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($this->app->getTheme()->getBasePath())) as $filename) { if (preg_match('/^.*\\.(tpl)$/i', $filename) && strpos($filename, '_') === false) { $routeFile = str_replace(array($this->app->getTheme()->getBasePath(), '.tpl'), '', $filename); $routeFile_r = explode('/', $routeFile); array_shift($routeFile_r); array_shift($routeFile_r); array_shift($routeFile_r); $route = implode('/', $routeFile_r); echo "about to run {$route}\n"; // ob_start(); $app->runControllerFromRawUrl($route); // ob_clean(); echo "tested route {$route}\n"; } } $this->assertTrue(true); }
<?php // === START === require_once 'bootstrap.php'; $app = __setupApp(); // === END === //errorLog("index.php, all parameters: " . print_r($_GET, true)); //error_log("index.php all params: ". print_r($_GET, true)); if (!$app->configIsEmpty('maintenance') && !$app->configIsEmpty('maintenanceIp') && $app->config('maintenance') == true && $_SERVER['REMOTE_ADDR'] != $app->config('maintenanceIp')) { header('Location: ' . $app->config('maintenancePath')); } else { if (empty($_GET['_url'])) { $_GET['_url'] = ''; } $app->runControllerFromRawUrl($_GET['_url']); }
public function testThemeUrl() { $app = __setupApp(); $this->assertEquals($app->config('baseUrl') . 'public/', $app->getTheme()->getPublicBaseUrl()); }
public function up() { $app = __setupApp(); $admin = $app->createModel('admin', array('name' => 'Admin', 'email' => '*****@*****.**', 'password' => 'lepass', 'password_confirmation' => 'lepass', 'status' => Admin::STATUS_ACTIVE)); R::store($admin); }