mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-21 06:19:38 +08:00
Update tests
This commit is contained in:
parent
e6e989281c
commit
cf03da0a2e
@ -55,9 +55,6 @@ class PluginController extends Controller
|
||||
|
||||
return json(trans('admin.plugins.operations.enabled', ['plugin' => $plugin->title]), 0);
|
||||
|
||||
case 'requirements':
|
||||
return json($this->getPluginDependencies($plugin));
|
||||
|
||||
case 'disable':
|
||||
$plugins->disable($name);
|
||||
|
||||
|
@ -436,16 +436,16 @@ class AuthControllerTest extends TestCase
|
||||
$this->assertAuthenticated();
|
||||
|
||||
// Require player name
|
||||
option(['register_with_player_name' => false]);
|
||||
option(['register_with_player_name' => true]);
|
||||
$this->postJson(
|
||||
'/auth/register',
|
||||
[
|
||||
'email' => 'a@b.c',
|
||||
'email' => 'abc@test.org',
|
||||
'password' => '12345678',
|
||||
'player_name' => 'name',
|
||||
'captcha' => 'a'
|
||||
]
|
||||
);
|
||||
)->assertJson(['errno' => 0]);
|
||||
$this->assertNotNull(Player::where('player_name', 'name'));
|
||||
}
|
||||
|
||||
|
@ -143,9 +143,12 @@ class MarketControllerTest extends TestCase
|
||||
|
||||
public function testMarketData()
|
||||
{
|
||||
$registry = $this->generateFakePluginsRegistry();
|
||||
$package = json_decode($registry, true)['packages'][0];
|
||||
$this->generateFakePlugin($package);
|
||||
$this->setupGuzzleClientMock([
|
||||
new RequestException('Connection Error', new Request('POST', 'whatever')),
|
||||
new Response(200, [], $this->generateFakePluginsRegistry()),
|
||||
new Response(200, [], $registry),
|
||||
]);
|
||||
|
||||
// Expected an exception, but unable to be asserted.
|
||||
@ -164,23 +167,6 @@ class MarketControllerTest extends TestCase
|
||||
'dependencies'
|
||||
]
|
||||
]);
|
||||
|
||||
// Detect installed plugins
|
||||
$this->appendToGuzzleQueue(200, [], $this->generateFakePluginsRegistry('fake', '0.0.1'));
|
||||
$this->generateFakePlugin(['name' => 'fake', 'version' => '0.0.1']);
|
||||
$this->getJson('/admin/plugins/market-data')
|
||||
->assertJsonStructure([
|
||||
[
|
||||
'name',
|
||||
'title',
|
||||
'version',
|
||||
'installed',
|
||||
'description',
|
||||
'author',
|
||||
'dist',
|
||||
'dependencies'
|
||||
]
|
||||
]);
|
||||
}
|
||||
|
||||
protected function tearDown()
|
||||
|
Loading…
Reference in New Issue
Block a user