Upgrade to Laravel 5.7

This commit is contained in:
Pig Fang 2018-09-06 16:26:03 +08:00
parent 9b11f2cf9b
commit 1a079c90c4
13 changed files with 644 additions and 250 deletions

View File

@ -6,7 +6,6 @@ use App\Events;
use Composer\Semver\Semver;
use Illuminate\Support\Arr;
use Illuminate\Support\Collection;
use App\Events\PluginWasUninstalled;
use Illuminate\Filesystem\Filesystem;
use App\Exceptions\PrettyPageException;
use Illuminate\Contracts\Events\Dispatcher;

View File

@ -9,7 +9,7 @@
"erusev/parsedown": "^1.6",
"swiggles/memcache": "^2.0",
"doctrine/inflector": "1.1.0",
"laravel/framework": "5.6.*",
"laravel/framework": "5.7.*",
"nesbot/carbon": "^1.32.0",
"devitek/yaml-translation": "^4.1.0",
"composer/semver": "^1.4",

865
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
<label for="{{ $id }}">
<input {!! $value ? 'checked="true"' : '' !!} type="checkbox" id="{{ $id }}" name="{{ $id }}" {{ $disabled or '' }} value="true"> {{ $label }}
<input {!! $value ? 'checked="true"' : '' !!} type="checkbox" id="{{ $id }}" name="{{ $id }}" {{ $disabled ?? '' }} value="true"> {{ $label }}
</label>

View File

@ -1,6 +1,6 @@
<div class="box box-{{ $type }}">
<div class="box-header with-border">
<h3 class="box-title">{{ $title }} {!! $hint or '' !!}</h3>
<h3 class="box-title">{{ $title }} {!! $hint ?? '' !!}</h3>
</div><!-- /.box-header -->
<form method="post">
@csrf
@ -19,7 +19,7 @@
@foreach($items as $item)
<tr>
@unless ($renderInputTagsOnly)
<td class="key">{{ $item->name }} {!! $item->hint or '' !!}</td>
<td class="key">{{ $item->name }} {!! $item->hint ?? '' !!}</td>
@endunless
<td class="value">

View File

@ -1,4 +1,4 @@
<select class="form-control" name="{{ $id }}" {{ $disabled or '' }}>
<select class="form-control" name="{{ $id }}" {{ $disabled ?? '' }}>
@foreach ((array) $options as $option)
<option {!! $selected == $option['value'] ? 'selected="selected"' : '' !!} value="{{ $option['value'] }}">{{ $option['name'] }}</option>

View File

@ -1 +1 @@
<input type="text" class="form-control" name="{{ $id }}" {{ $disabled or '' }} value="{{ $value }}" placeholder="{{ $placeholder or '' }}">
<input type="text" class="form-control" name="{{ $id }}" {{ $disabled ?? '' }} value="{{ $value }}" placeholder="{{ $placeholder ?? '' }}">

View File

@ -1 +1 @@
<textarea class="form-control" rows="{{ $rows }}" name="{{ $id }}" {{ $disabled or '' }}>{{ $value }}</textarea>
<textarea class="form-control" rows="{{ $rows }}" name="{{ $id }}" {{ $disabled ?? '' }}>{{ $value }}</textarea>

View File

@ -1,5 +1,5 @@
<div class="box-header with-border">
<h3 class="box-title" style="width: 100%;">{!! $title or trans('general.texture-preview') !!}
<h3 class="box-title" style="width: 100%;">{!! $title ?? trans('general.texture-preview') !!}
<span id="textures-indicator" data-toggle="tooltip" title="" class="badge bg-light-blue"></span>
<div class="operations">
<i data-toggle="tooltip" data-placement="bottom" title="@lang('general.walk').' / '.trans('general.run')" class="fa fa-forward"></i>

View File

@ -176,6 +176,7 @@ class MarketControllerTest extends TestCase
// Clean fake plugins
File::deleteDirectory(base_path('plugins/fake-test-download'));
File::deleteDirectory(base_path('plugins/fake-test-update'));
File::delete(base_path('plugins/whatever'));
parent::tearDown();
}

View File

@ -40,7 +40,7 @@ class PluginControllerTest extends TestCase
// Plugin is enabled but it doesn't have config view
plugin('fake-plugin-for-test')->setEnabled(true);
$this->get('/admin/plugins/config/avatar-api')
->assertSee(trans('admin.plugins.operations.no-config-notice'))
->assertSee(e(trans('admin.plugins.operations.no-config-notice')))
->assertNotFound();
// Plugin has config view
@ -91,7 +91,6 @@ class PluginControllerTest extends TestCase
// Enable a plugin
app('plugins')->getPlugin('fake-plugin-for-test')->setRequirements([]);
$this->expectsEvents(Events\PluginWasEnabled::class);
$this->postJson('/admin/plugins/manage', [
'name' => 'fake-plugin-for-test',
'action' => 'enable'
@ -114,7 +113,6 @@ class PluginControllerTest extends TestCase
['plugin' => plugin('fake-plugin-for-test')->title]
)
]);
$this->expectsEvents(Events\PluginWasDisabled::class);
// Delete a plugin
$this->postJson('/admin/plugins/manage', [
@ -124,7 +122,6 @@ class PluginControllerTest extends TestCase
'errno' => 0,
'msg' => trans('admin.plugins.operations.deleted')
]);
$this->expectsEvents(Events\PluginWasDeleted::class);
$this->assertFalse(file_exists(base_path('plugins/fake-plugin-for-test/')));
}

View File

@ -52,7 +52,7 @@ class SetupControllerTest extends TestCase
{
$fake = [
'type' => 'mysql',
'host' => '127.0.0.1',
'host' => env('DB_HOST'),
'port' => '3306',
'db' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),

View File

@ -123,7 +123,7 @@ class TextureControllerTest extends TestCase
]);
$this->get("/skin/{$player->player_name}.png")
->assertSee(trans('general.texture-not-uploaded', ['type' => 'alex']));
->assertSee(e(trans('general.texture-not-uploaded', ['type' => 'alex'])));
$player->setPreference('default');
$this->get("/skin/{$player->player_name}.png")
@ -148,7 +148,7 @@ class TextureControllerTest extends TestCase
]);
$this->get("/skin/alex/{$player->player_name}.png")
->assertSee(trans('general.texture-not-uploaded', ['type' => 'alex']));
->assertSee(e(trans('general.texture-not-uploaded', ['type' => 'alex'])));
$player->setPreference('default');
$this->get("/skin/steve/{$player->player_name}.png")