Fix ServicesTest/HookTest
This commit is contained in:
parent
8aa3416260
commit
f7de3c026d
|
|
@ -4,6 +4,8 @@ use App\Services\Hook;
|
||||||
|
|
||||||
class HookTest extends TestCase
|
class HookTest extends TestCase
|
||||||
{
|
{
|
||||||
|
use GeneratesFakePlugins;
|
||||||
|
|
||||||
public function testAddMenuItem()
|
public function testAddMenuItem()
|
||||||
{
|
{
|
||||||
Hook::addMenuItem('user', 0, [
|
Hook::addMenuItem('user', 0, [
|
||||||
|
|
@ -22,9 +24,15 @@ class HookTest extends TestCase
|
||||||
|
|
||||||
public function testRegisterPluginTransScripts()
|
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('/')
|
$this->get('/')
|
||||||
->see('example-plugin/lang/en/locale.js');
|
->see('fake-plugin-with-i18n/lang/en/locale.js');
|
||||||
|
|
||||||
|
File::deleteDirectory(base_path('plugins/fake-plugin-with-i18n'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddStyleFileToPage()
|
public function testAddStyleFileToPage()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user