Fixes unit tests

This commit is contained in:
Samuel Georges 2015-02-10 17:45:27 +11:00
parent 8c1d0aa7da
commit f6371d532b
5 changed files with 23 additions and 103 deletions

View File

@ -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

View File

@ -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',
);

View File

@ -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);
}

View File

@ -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;
}

View File

@ -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');