remove middlewares for profile API
This commit is contained in:
parent
f46737c8e3
commit
4a97edbd53
@ -1,9 +1,7 @@
|
||||
<?php
|
||||
|
||||
Route::group(['middleware' => 'player'], function () {
|
||||
Route::get('/{player}.json', 'TextureController@json');
|
||||
Route::get('/csl/{player}.json', 'TextureController@json');
|
||||
});
|
||||
|
||||
Route::get('/textures/{hash}', 'TextureController@texture');
|
||||
|
||||
|
@ -26,9 +26,7 @@ class TextureControllerTest extends TestCase
|
||||
$steve = factory(Texture::class)->create();
|
||||
|
||||
// Player is not existed
|
||||
$this->get('/nope.json')
|
||||
->assertSee(trans('general.unexistent-player'))
|
||||
->assertStatus(404);
|
||||
$this->get('/nope.json')->assertStatus(404);
|
||||
|
||||
// Player is banned
|
||||
$player = factory(Player::class)->create(['tid_skin' => $steve->tid]);
|
||||
|
@ -14,20 +14,12 @@ class CheckPlayerExistTest extends TestCase
|
||||
{
|
||||
Event::fake();
|
||||
|
||||
$this->getJson('/nope.json')
|
||||
->assertStatus(404)
|
||||
->assertSee(trans('general.unexistent-player'));
|
||||
|
||||
option(['return_204_when_notfound' => true]);
|
||||
$this->getJson('/nope.json')->assertNoContent();
|
||||
$this->getJson('/nope.json')->assertStatus(404);
|
||||
|
||||
$player = factory(Player::class)->create();
|
||||
$this->getJson("/{$player->name}.json")
|
||||
->assertJson(['username' => $player->name]); // Default is CSL API
|
||||
|
||||
$this->getJson("/{$player->name}.json");
|
||||
Event::assertDispatched(\App\Events\CheckPlayerExists::class);
|
||||
|
||||
$player = factory(Player::class)->create();
|
||||
$user = $player->user;
|
||||
$this->actingAs($user)
|
||||
|
Loading…
Reference in New Issue
Block a user