提交 11a6fcdc 编写于 作者: E eddy8

improve

上级 7352b3cf
......@@ -23,14 +23,14 @@ class NEditorController extends Controller
*/
public function serve(Request $request, $type)
{
if (!method_exists(\self::class, $type)) {
if (!method_exists(self::class, $type)) {
return [
'code' => 1,
'msg' => '未知操作'
];
}
return call_user_func(\self::class . '::' . $type, $request);
return call_user_func(self::class . '::' . $type, $request);
}
protected function uploadImage(Request $request)
......
......@@ -24,13 +24,13 @@ class UEditorController extends NEditorController
public function serve(Request $request, $type = null)
{
$action = $request->input('action');
if (!method_exists(\self::class, $action)) {
if (!method_exists(self::class, $action)) {
return [
'state' => '未知操作',
];
}
return call_user_func(\self::class . '::' . $action, $request);
return call_user_func(self::class . '::' . $action, $request);
}
protected function config()
......
......@@ -6,6 +6,7 @@ use App\Model\Admin\AdminUser;
use App\Model\Admin\Entity;
use App\Model\Admin\EntityField;
use App\Repository\Admin\EntityRepository;
use App\Repository\Admin\ContentRepository;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Illuminate\Support\Facades\Schema;
use Tests\TestCase;
......@@ -111,6 +112,7 @@ class EntityFieldControllerTest extends TestCase
$response = $this->actingAs($this->user, 'admin')
->put('/admin/entity/' . $this->entity->id . '/contents/1', $updateData);
$response->assertJson(['code' => 0]);
$this->assertEquals('tag1,tag3', ContentRepository::tagNames($this->entity->id, 1));
$this->assertDatabaseHas($this->entity->table_name, ['title' => $updateData['title']]);
$response = $this->actingAs($this->user, 'admin')
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册