コード例 #1
0
    function webpage()
    {
        $scope1 = $this->scope->create_scope(0, 2);
        $scope2 = $this->scope->create_scope(6, 9);
        $url = 'http://www.plurk.com/p/6cz3zb';
        $text = '雖然感覺上70/182的進度大有嶄進,但是之前寫好的一些仍有問題,要想辦法做測試才行。
';
        $scope_another = $this->scope->create_scope(1, 7, $text, $url);
        $coll = new Annotation_scope_collection();
        $coll->add_scope($scope1);
        $this->unit->run($coll->get_scope_length(), 3, "set_scopes 0~2之後測試get_scope_length()");
        $coll->add_scope($scope2);
        $this->unit->run($coll->get_scope_length(), 7, "set_scopes 6~9之後測試get_scope_length()");
        $coll->add_scope($scope_another);
        $this->unit->run($coll->get_scope_length(), 14, "set_scopes 1~7 another webpage之後測試get_scope_length()");
        $this->unit->run($coll->length(), 3, "set_scopes 1~7 another webpage之後測試length()");
        unit_test_report($this);
    }
コード例 #2
0
ファイル: ut_annotation.php プロジェクト: 119155012/kals
 public function like()
 {
     $url = 'http://www.plurk.com/p/67k6st#response-1739920625';
     $text1 = '[CODING D17] 晚上睡覺時天氣、室溫、冷氣、電扇、被子的厚度與蓋的方法,組合起來就可以預測隔天會不會一整天過敏。但我還沒有明顯地分辨出他們的關聯。';
     $text2 = '變項太多,這回歸的組合也不知道要排到什麼時候orz';
     $note = '「西瓜牛奶去冰的話可能沒有滿杯喔」由於店員這樣說,所以我改口跟他說不用去冰好了……結果還是一樣沒有滿杯orz';
     $email = '*****@*****.**';
     $email_siroma = '*****@*****.**';
     $scope1 = $this->annotation_scope->create_scope(3, 20, $text1, $url);
     $scope2 = $this->annotation_scope->create_scope(26, 40, $text2, $url);
     $scope_coll = new Annotation_scope_collection();
     $scope_coll->add_scope($scope1);
     $scope_coll->add_scope($scope2);
     $len = $scope_coll->get_scope_length();
     $user = $this->user->create_user($url, $email);
     $user_siroma = $this->user->create_user($url, $email_siroma);
     $annotation = $this->annotation->create_annotation($user, $scope_coll);
     $email_like = '*****@*****.**';
     $user_like = $this->user->create_user($url, $email_like);
     $this->unit->run($annotation->get_like_count(), 0, 'like測試,加入user_like之前 get_like_count()');
     $annotation->add_like($user_like);
     $this->unit->run($annotation->get_like_count(), 1, 'like測試,加入user_like之後 get_like_count()');
     $annotation->remove_like($user_like);
     $this->unit->run($annotation->get_like_count(), 0, 'like測試,移除user_like之後 get_like_count()');
     $annotation->add_like($user_like);
     $this->unit->run($annotation->get_like_count(), 1, 'like測試,再加入user_like之後 get_like_count()');
     unit_test_report($this);
 }
コード例 #3
0
ファイル: ut_notification.php プロジェクト: 119155012/kals
 /**
  * @return Annotation
  */
 function create_annotation()
 {
     $url = $this->url;
     $text1 = '[CODING D17] 晚上睡覺時天氣、室溫、冷氣、電扇、被子的厚度與蓋的方法,組合起來就可以預測隔天會不會一整天過敏。但我還沒有明顯地分辨出他們的關聯。';
     $text2 = '變項太多,這回歸的組合也不知道要排到什麼時候orz';
     $note = '「西瓜牛奶去冰的話可能沒有滿杯喔」由於店員這樣說,所以我改口跟他說不用去冰好了……結果還是一樣沒有滿杯orz';
     $email = '*****@*****.**';
     $scope1 = $this->annotation_scope->create_scope(3, 20, $text1, $url);
     $scope2 = $this->annotation_scope->create_scope(26, 40, $text2, $url);
     $scope_coll = new Annotation_scope_collection();
     $scope_coll->add_scope($scope1);
     $scope_coll->add_scope($scope2);
     $len = $scope_coll->get_scope_length();
     $user = $this->user->create_user($url, $email);
     $annotation = $this->annotation->create_annotation($user, $scope_coll);
     $this->association_user = $user;
     return $annotation;
 }