'Go to closet', 'link' => '/user/closet', 'icon' => 'fa-book' ]); $this->actAs('normal') ->visit('/user') ->see('Go to closet') ->see('/user/closet') ->see('fa-book') ->click('Go to closet') ->seePageIs('/user/closet'); } public function testRegisterPluginTransScripts() { $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('/') ->see('fake-plugin-with-i18n/lang/en/locale.js'); File::deleteDirectory(base_path('plugins/fake-plugin-with-i18n')); } public function testAddStyleFileToPage() { Hook::addStyleFileToPage('/style/all'); $this->visit('/') ->see(''); Hook::addStyleFileToPage('/style/pattern', ['skinlib']); $this->visit('/') ->dontSee(''); $this->visit('/skinlib') ->see(''); } public function testAddScriptFileToPage() { Hook::addScriptFileToPage('/script/all'); $this->visit('/') ->see(''); Hook::addScriptFileToPage('/script/pattern', ['skinlib']); $this->visit('/') ->dontSee(''); $this->visit('/skinlib') ->see(''); } }