TestAuthor.php 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: stanley-king
  5. * Date: 2017/4/26
  6. * Time: 上午11:55
  7. */
  8. define('BASE_ROOT_PATH',str_replace('/test','',dirname(__FILE__)));
  9. require_once (BASE_ROOT_PATH . '/fooder.php');
  10. require_once (BASE_ROOT_PATH . '/helper/third_author/wxauthor.php');
  11. require_once (BASE_ROOT_PATH . '/helper/third_author/signaturer.php');
  12. require_once (BASE_ROOT_PATH . '/helper/login_helper.php');
  13. class TestAuthor extends PHPUnit_Framework_TestCase
  14. {
  15. public static function setUpBeforeClass()
  16. {
  17. Base::run_util();
  18. }
  19. public function testWxauthor()
  20. {
  21. $author = new thrid_author\wxauthor();
  22. $author->enter();
  23. }
  24. public function testOnbind()
  25. {
  26. login_helper::onBinded('18911779278','3568');
  27. }
  28. public function testOrigin()
  29. {
  30. $val = 'Mozilla/5.0 (iPhone; CPU iPhone OS 10_2 like Mac OS X) AppleWebKit/602.3.12 (KHTML, like Gecko) Mobile/14C92 MicroMessenger/6.5.7 NetType/WIFI Language/zh_CN';
  31. $pos = strpos($val,"MicroMessenger");
  32. }
  33. public function testSignature()
  34. {
  35. thrid_author\signaturer::instance()->signurl("http://p.lrlz.com");
  36. }
  37. public function testOption()
  38. {
  39. $setting = 'a:8:{s:10:"home_title";s:0:"";s:5:"image";s:87:"http://lrlz-image.oss-cn-shenzhen.aliyuncs.com/957DBC63-6D1D-41BD-AD43-7F6E3162EE02.jpg";s:9:"show_type";s:5:"image";s:9:"show_data";s:87:"http://lrlz-image.oss-cn-shenzhen.aliyuncs.com/957DBC63-6D1D-41BD-AD43-7F6E3162EE02.jpg";s:4:"type";s:0:"";s:4:"data";s:0:"";s:5:"title";s:0:"";s:8:"reserved";s:0:"";}';
  40. $ssetting = unserialize($setting);
  41. $sjson = '{
  42. "home_title":"",
  43. "image":"http://lrlz-image.oss-cn-shenzhen.aliyuncs.com/FD9CFCF4-6F48-4E6E-A075-7A8C52E6416F.jpg",
  44. "show_type":"image",
  45. "show_data":"http://lrlz-image.oss-cn-shenzhen.aliyuncs.com/FD9CFCF4-6F48-4E6E-A075-7A8C52E6416F.jpg",
  46. "type":"",
  47. "data":"",
  48. "title":"",
  49. "reserved":""
  50. }';
  51. $sjson = json_decode($sjson,true);
  52. $setting = serialize($sjson);
  53. $dsetting = unserialize($setting);
  54. }
  55. }