stanley-king 7 lat temu
rodzic
commit
ea260b6892
4 zmienionych plików z 23 dodań i 3 usunięć
  1. 9 0
      helper/ugc/factory.php
  2. 1 0
      helper/ugc/ugc_content.php
  3. 4 1
      helper/ugc_helper.php
  4. 9 2
      test/TestUGC.php

+ 9 - 0
helper/ugc/factory.php

@@ -11,5 +11,14 @@ namespace ugc;
 
 class factory
 {
+    public static function crate_special($data)
+    {
+        if(empty($data)) {
+            return false;
+        }
+
+        $spobj = new special_object();
+        $spobj->set_share("",);
+    }
 
 }

+ 1 - 0
helper/ugc/ugc_content.php

@@ -96,5 +96,6 @@ class special_object
 
     public function save()
     {
+
     }
 }

+ 4 - 1
helper/ugc_helper.php

@@ -11,5 +11,8 @@ require_once (BASE_ROOT_PATH . '/helper/ugc/ugc_content.php');
 
 class ugc_helper
 {
-
+    public static function crate_special($data)
+    {
+        //$special = \ugc\factory()
+    }
 }

+ 9 - 2
test/TestUGC.php

@@ -19,8 +19,15 @@ class TestUGC extends PHPUnit_Framework_TestCase
     }
     public function testSpecialObj()
     {
-        $spobj = new ugc\special_object();
-        $spobj->set_share("测试","http://192.168.0.200/data/upload/mobile/special/s0/s0_05240528172336404.png");
+        $special['share_title'] = '测试';
+        $special['share_image'] = "http://192.168.0.200/data/upload/mobile/special/s0/s0_05240528172336404.png";
 
+        $item['type'] = 'images';
+        $item['images'][] = "http://192.168.0.200/data/upload/mobile/special/s0/s0_05240528172336404.png";
+
+        $item['title'] = '第一次见到大海';
+        $special['items'][] = $item;
+
+        $spobj = ugc_helper::crate_special($special);
     }
 }