From d01c18b379a7ab1e0c5f803dad931613df7fbc64 Mon Sep 17 00:00:00 2001 From: printempw Date: Fri, 16 Feb 2018 17:53:10 +0800 Subject: [PATCH] Update tests for PluginController --- tests/PluginControllerTest.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/PluginControllerTest.php b/tests/PluginControllerTest.php index ee3d7704..cbf70e31 100644 --- a/tests/PluginControllerTest.php +++ b/tests/PluginControllerTest.php @@ -17,10 +17,15 @@ class PluginControllerTest extends TestCase 'avatar-api' => 'avatar-api_v1.1.zip' ]; foreach ($plugins as $plugin_name => $filename) { - if (!file_exists(base_path('plugins/'.$plugin_name))) { + if (! file_exists(base_path('plugins/'.$plugin_name))) { + $context = stream_context_create(['http' => [ + 'method' => "GET", + 'header' => "User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.140 Safari/537.36" + ]]); + file_put_contents( storage_path('testing/'.$filename), - file_get_contents("https://github.com/printempw/blessing-skin-plugins/raw/master/dist/$filename") + file_get_contents("https://coding.net/u/printempw/p/bs-plugins-archive/git/raw/master/$filename", false, $context) ); $zip = new ZipArchive();