This commit is contained in:
Pig Fang 2020-03-09 15:26:28 +08:00
parent db49cedb06
commit 6463a33744
2 changed files with 5 additions and 5 deletions

View File

@ -223,7 +223,9 @@ class PluginManager
{
$providers = Arr::get($plugin->getManifest(), 'enchants.providers', []);
array_walk($providers, function ($provider) use ($plugin) {
$class = Str::start(Str::finish($provider, 'ServiceProvider'), $plugin->namespace.'\\');
$class = (string) Str::of($provider)
->finish('ServiceProvider')
->start($plugin->namespace.'\\');
if (class_exists($class)) {
$this->app->register($class);
}

View File

@ -109,8 +109,7 @@ class SkinlibControllerTest extends TestCase
$keyword = Str::limit($skins->random()->name, 1, '');
$keyworded = $skins
->filter(function ($texture) use ($keyword) {
return Str::contains($texture->name, $keyword) ||
Str::contains($texture->name, strtolower($keyword));
return Str::contains($texture->name, [$keyword, strtolower($keyword)]);
});
$items = $this->getJson('/skinlib/data?keyword='.$keyword)
->assertJson(['data' => [
@ -124,8 +123,7 @@ class SkinlibControllerTest extends TestCase
$keyword = Str::limit($skins->random()->name, 1, '');
$filtered = $skins
->filter(function ($texture) use ($keyword) {
return Str::contains($texture->name, $keyword) ||
Str::contains($texture->name, strtolower($keyword));
return Str::contains($texture->name, [$keyword, strtolower($keyword)]);
})
->sortByDesc('size')
->map(function ($skin) {