diff --git a/test/fixtures/999_test_data.yml b/test/fixtures/999_test_data.yml index 6c456ce..22656bc 100644 --- a/test/fixtures/999_test_data.yml +++ b/test/fixtures/999_test_data.yml @@ -19,10 +19,6 @@ Member: id: 5 name: "Tom" is_active: 1 - member_html_1: - id: 1055 - name: "<&\"'>Member.name ESCAPING HTML TEST DATA" - is_active: 1 MemberConfig: member_address_1: @@ -86,6 +82,12 @@ MemberConfig: value: "" Member: member_5 +AdminUser: + first_admin: + id: ~ + username: "admin" + password: "password" + Community: community_a: name: "「あ」コミュニティ" @@ -246,12 +248,14 @@ CommunityTopic: body: "こんにちは" Community: community_e Member: member_4 - community_topic_html_1: - id: 1055 - name: "<&\"'>CommunityTopic.name ESCAPING HTML TEST DATA" - body: "<&\"'>CommunityTopic.body ESCAPING HTML TEST DATA" + + community_topic_dummy_: + id: "" + name: "dummyTitle" + body: "dummyBody" Community: community_a - Member: member_html_1 + Member: member_1 + CommunityTopicComment: community_topic_comment_a_2: @@ -286,11 +290,13 @@ CommunityTopicComment: body: "こんにちは" CommunityTopic: community_topic_e_4 Member: member_5 - community_topic_comment_html_1: - id: 1055 - body: "<&\"'>CommunityTopicComment.body ESCAPING HTML TEST DATA" - CommunityTopic: community_topic_html_1 - Member: member_html_1 + + community_topic_comment_dummy_1_: + id: "" + body: "dummyBody" + CommunityTopic: community_topic_dummy_20 + Member: member_1 + CommunityEvent: community_event_a_2: @@ -311,15 +317,17 @@ CommunityEvent: open_date_comment: 'いきしちに' area: '佐賀県' - community_event_html_1: - id: 1055 - Community: community_i - Member: member_2 - name: "<&\"'>CommunityEvent.name ESCAPING HTML TEST DATA" - body: "<&\"'>CommunityEvent.body ESCAPING HTML TEST DATA" - open_date: '2009-06-11' - open_date_comment: "<&\"'>CommunityEvent.open_date_comment ESCAPING HTML TEST DATA" - area: "<&\"'>CommunityEvent.area ESCAPING HTML TEST DATA" + + community_event_dummy_: + id: "" + Community: community_a + Member: member_1 + name: "dummyTitle" + body: "dummyBody" + open_date: '2000-01-01' + open_date_comment: 'dummyDate' + area: 'dummyArea' + CommunityEventComment: community_event_comment_a_2: @@ -330,11 +338,13 @@ CommunityEventComment: CommunityEvent: community_event_i_2 Member: member_5 body: 'こんにちは' - community_event_comment_html_1: - id: 1055 - CommunityEvent: community_event_html_1 - Member: member_html_1 - body: "<&\"'>CommunityEventComment.body ESCAPING HTML TEST DATA" + + community_event_comment_dummy_1_: + id: "" + CommunityEvent: community_event_dummy_20 + body: "dummyBody" + Member: member_1 + CommunityEventMember: community_event_member_a_1: @@ -343,7 +353,3 @@ CommunityEventMember: community_event_member_a_2: CommunityEvent: community_event_a_2 Member: member_2 - community_event_member_html_1: - id: 1055 - CommunityEvent: community_event_html_1 - Member: member_html_1 diff --git a/test/fixtures/999_xss_test_data.yml b/test/fixtures/999_xss_test_data.yml index 1cf42b0..0cfab4d 100644 --- a/test/fixtures/999_xss_test_data.yml +++ b/test/fixtures/999_xss_test_data.yml @@ -43,6 +43,13 @@ Community: id: 1055 name: "<&\"'>Community.name ESCAPING HTML TEST DATA" +CommunityConfig: + html_community_1_public_flag: + id: 1055 + Community: html_community_1 + name: "public_flag" + value: "public" + CommunityMember: html_community_1_html_member_1: Community: html_community_1 diff --git a/test/functional/pc_backend/communityTopicPagerTest.class.php b/test/functional/pc_backend/communityTopicPagerTest.class.php new file mode 100644 index 0000000..8fcecec --- /dev/null +++ b/test/functional/pc_backend/communityTopicPagerTest.class.php @@ -0,0 +1,61 @@ +info('Login') + ->get('/default/login') + ->click('ログイン', array('admin_user' => array( + 'username' => 'admin', + 'password' => 'password', + ))) + ->isStatusCode(302); + +foreach (array('topic', 'event') as $target) +{ + $test + ->info('communityTopic/'.$target.'List: Pager test') + ->get('/communityTopic/'.$target.'List') + + //------------------------------------------- + // トピック/イベント検索 + + // 1 ページ目 (30 件中 1 - 20件目) + ->click('検索', array('community'.ucfirst($target) => array( + 'body' => array('text' => 'dummyBody'), + ))) + ->with('response')->begin() + ->checkElement('th:contains("作成日時")', 20) + ->end() + + // 2 ページ目 (30 件中 21 - 30件目) + ->click('次を表示') + ->with('response')->begin() + ->checkElement('th:contains("作成日時")', 10) + ->end() + + //------------------------------------------- + // コメント検索 + + ->info('communityTopic/'.$target.'CommentList: Pager test') + ->get('/communityTopic/'.$target.'CommentList') + + // 1 ページ目 (30 件中 1 - 20件目) + ->click('検索', array('community'.ucfirst($target).'Comment' => array( + 'community_'.$target.'_id' => array('text' => '20'), // Bug #2597 のためトピックIDの指定が必須 + 'body' => array('text' => 'dummyBody'), + ))) + ->with('response')->begin() + ->checkElement('th:contains("作成日時")', 20) + ->end() + + // 2 ページ目 (30 件中 21 - 30件目) + ->click('次を表示') + ->with('response')->begin() + ->checkElement('th:contains("作成日時")', 10) + ->end(); +}