From f6371d532bcf0a5e03edeb5100cc65e5f8e12bc7 Mon Sep 17 00:00:00 2001 From: Samuel Georges Date: Tue, 10 Feb 2015 17:45:27 +1100 Subject: [PATCH] Fixes unit tests --- UPGRADE.md | 98 ------------------------------ config/testing/cms.php | 21 ++++++- modules/cms/classes/Router.php | 3 +- modules/system/ServiceProvider.php | 2 +- tests/TestCase.php | 2 +- 5 files changed, 23 insertions(+), 103 deletions(-) delete mode 100644 UPGRADE.md diff --git a/UPGRADE.md b/UPGRADE.md deleted file mode 100644 index 4bc3a6aef..000000000 --- a/UPGRADE.md +++ /dev/null @@ -1,98 +0,0 @@ -### Renamed classes: - - October\Rain\Support\Yaml -> Yaml - October\Rain\Support\Markdown -> Markdown - System\Classes\ApplicationException -> ApplicationException - System\Classes\SystemException -> SystemException - October\Rain\Support\ValidationException -> ValidationException - -### File system changes - - [MOVE] /app/config -> /config - [MOVE] /app/storage -> /storage - [DELETE] /bootstrap/start.php - [DELETE] /bootstrap/autoload.php - [DELETE] /artisan - [SPAWN] /bootstrap/app.php - [SPAWN] /bootstrap/autoload.php - [SPAWN] /artisan - [SPAWN] /storage/cms/*.* - [SPAWN] /storage/framework/*.* - -*SPAWN* means to create a file using the git source. - -### Cron job changes - -Remove old cron jobs: - - * * * * * php /path/to/artisan queue:cron 1>> /dev/null 2>&1 - * * * * * php /path/to/artisan scheduled:run 1>> /dev/null 2>&1 - -Add new cron job: - - * * * * * php /path/to/artisan schedule:run 1>> /dev/null 2>&1 - -### Clean up - -Optional things you can delete, if they do not contain anything custom. - - [DELETE] /app/start/artisan.php - [DELETE] /app/start/global.php - [DELETE] /app/filters.php - [DELETE] /app/routes.php - [DELETE] /app - [DELETE] /storage/cache - [DELETE] /storage/combiner - [DELETE] /storage/twig - -Tables that can be deleted: - - Schema::dropIfExists('cron_queue'); - -### Removed config - - cms.tempDir - use temp_path() - -### Breaking code changes - -#### Dispatcher has been removed - -Dispatcher functionality is now baked in to Laravel, check the Plugin registration documentation for more information. - -#### Removed PATH_* constants - -- PATH_APP - use app_path() -- PATH_BASE - use base_path() -- PATH_PUBLIC - use public_path() -- PATH_STORAGE - use storage_path() -- PATH_PLUGINS - use plugins_path() - -#### Paginator / setCurrentPage - -**App::make('paginator')->setCurrentPage(5);** should no longer be used, instead pass as the second argument with the `paginate()` method `$model->paginate(25, 5);` - -Old code: - - App::make('paginator')->setCurrentPage($page); - $model->paginate($perPage); - -New code: - - $model->paginate($perPage, $page); - -##### Paginator API changes - -The following methods have changed: - - getTotal() -> total() - getCurrentPage() -> currentPage() - getLastPage() -> lastPage() - getFrom() -> firstItem() - getTo() -> lastItem() - -### Things to do - -- Remove "Cron" package, test new "jobs" table -- Test scheduler -- Remove deprecated code -- Fix unit tests \ No newline at end of file diff --git a/config/testing/cms.php b/config/testing/cms.php index 181bada7d..f0c04f03f 100644 --- a/config/testing/cms.php +++ b/config/testing/cms.php @@ -22,7 +22,7 @@ return array( | */ - 'pluginsDir' => '/tests/fixtures/system/plugins', + 'pluginsDir' => '/tests/fixtures/plugins', /* |-------------------------------------------------------------------------- @@ -33,7 +33,7 @@ return array( | */ - 'themesDir' => '/tests/fixtures/cms/themes', + 'themesDir' => '/tests/fixtures/themes', /* |-------------------------------------------------------------------------- @@ -108,4 +108,21 @@ return array( */ 'convertLineEndings' => true, + + /* + |-------------------------------------------------------------------------- + | Linking policy + |-------------------------------------------------------------------------- + | + | Controls how URL links are generated throughout the application. + | + | relative - relative to the application, schema and hostname is omitted + | detect - detect hostname and use the current schema + | secure - detect hostname and force HTTPS schema + | insecure - detect hostname and force HTTP schema + | force - force hostname and schema using app.url config value + | + */ + + 'linkPolicy' => 'relative', ); diff --git a/modules/cms/classes/Router.php b/modules/cms/classes/Router.php index 0532769a6..779947e19 100644 --- a/modules/cms/classes/Router.php +++ b/modules/cms/classes/Router.php @@ -84,9 +84,10 @@ class Router $urlList = []; $cacheable = Config::get('cms.enableRoutesCache') && in_array( - Config::get('cache.driver'), + Cache::getDefaultDriver(), ['apc', 'memcached', 'redis', 'array'] ); + if ($cacheable) { $fileName = $this->getCachedUrlFileName($url, $urlList); } diff --git a/modules/system/ServiceProvider.php b/modules/system/ServiceProvider.php index dc5b8b518..3a1fb405a 100644 --- a/modules/system/ServiceProvider.php +++ b/modules/system/ServiceProvider.php @@ -141,7 +141,7 @@ class ServiceProvider extends ModuleServiceProvider /* * Override standard Mailer content with template */ - Event::listen('mailer.beforeAddContent', function ($mailer, $message, $view, $plain, $data) { + Event::listen('mailer.beforeAddContent', function ($mailer, $message, $view, $data) { if (MailTemplate::addContentToMailer($message, $view, $data)) { return false; } diff --git a/tests/TestCase.php b/tests/TestCase.php index 2d1893598..073b27ed9 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -13,7 +13,7 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase $app = require __DIR__.'/../bootstrap/app.php'; $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap(); - $app['config']->set('cache.default', 'array'); + $app['cache']->setDefaultDriver('array'); $app->setLocale('en');