mirror of
https://github.com/bs-community/blessing-skin-server.git
synced 2024-12-15 06:09:58 +08:00
Fix tests
This commit is contained in:
parent
47a0a24a5e
commit
e6e989281c
@ -44,8 +44,8 @@ class PluginControllerTest extends TestCase
|
||||
->assertNotFound();
|
||||
|
||||
// Plugin has config view
|
||||
plugin('example-plugin')->setEnabled(true);
|
||||
$this->get('/admin/plugins/config/example-plugin')
|
||||
plugin('fake-plugin-with-config-view')->setEnabled(true);
|
||||
$this->get('/admin/plugins/config/fake-plugin-with-config-view')
|
||||
->assertSuccessful();
|
||||
}
|
||||
|
||||
|
@ -3,9 +3,13 @@
|
||||
namespace Tests;
|
||||
|
||||
use App\Services\Hook;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use Tests\Concerns\GeneratesFakePlugins;
|
||||
|
||||
class HookTest extends TestCase
|
||||
{
|
||||
use GeneratesFakePlugins;
|
||||
|
||||
public function testAddMenuItem()
|
||||
{
|
||||
Hook::addMenuItem('user', 0, [
|
||||
@ -22,9 +26,15 @@ class HookTest extends TestCase
|
||||
|
||||
public function testRegisterPluginTransScripts()
|
||||
{
|
||||
Hook::registerPluginTransScripts('example-plugin');
|
||||
$this->generateFakePlugin(['name' => 'fake-plugin-with-i18n', 'version' => '0.0.1']);
|
||||
@mkdir($path = base_path('plugins/fake-plugin-with-i18n/lang/en'), 0755, true);
|
||||
file_put_contents("$path/locale.js", '');
|
||||
|
||||
Hook::registerPluginTransScripts('fake-plugin-with-i18n');
|
||||
$this->get('/')
|
||||
->assertSee('example-plugin/lang/en/locale.js');
|
||||
->assertSee('fake-plugin-with-i18n/lang/en/locale.js');
|
||||
|
||||
File::deleteDirectory(base_path('plugins/fake-plugin-with-i18n'));
|
||||
}
|
||||
|
||||
public function testAddStyleFileToPage()
|
||||
|
Loading…
Reference in New Issue
Block a user