Changeset 7819
- Timestamp:
- 10/04/2026 05:55:21 PM (6 weeks ago)
- Location:
- trunk/tests/phpunit
- Files:
-
- 2 added
- 2 edited
-
includes/feed-rss2-runner.php (added)
-
includes/feed-rss2-test.php (added)
-
testcases/replies/functions/reply.php (modified) (1 diff)
-
testcases/topics/functions/topic.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/replies/functions/reply.php
r7815 r7819 621 621 /** 622 622 * @covers ::bbp_display_replies_feed_rss2 623 * @todo Implement test_bbp_display_replies_feed_rss2().624 623 */ 625 624 public function test_bbp_display_replies_feed_rss2() { 626 // Remove the following lines when you implement this test. 627 $this->markTestIncomplete( 628 'This test has not been implemented yet.' 629 ); 625 require_once dirname( __DIR__, 3 ) . '/includes/feed-rss2-test.php'; 626 627 $feed = new DOMDocument(); 628 $xml = bbp_test_run_feed_rss2( 'replies' ); 629 $valid = $feed->loadXML( $xml ); 630 $this->assertTrue( $valid, $xml ); 631 632 $items = $feed->getElementsByTagName( 'item' ); 633 $this->assertSame( 1, $items->length ); 634 $this->assertSame( 'Feed Test Reply', $items->item( 0 )->getElementsByTagName( 'title' )->item( 0 )->textContent ); 635 $this->assertStringContainsString( 'Feed test reply content', $items->item( 0 )->textContent ); 636 $this->assertStringNotContainsString( 'Private Feed Reply', $xml ); 637 $this->assertStringNotContainsString( 'Private reply secret content', $xml ); 630 638 } 631 639 -
trunk/tests/phpunit/testcases/topics/functions/topic.php
r7811 r7819 930 930 /** 931 931 * @covers ::bbp_display_topics_feed_rss2 932 * @todo Implement test_bbp_display_topics_feed_rss2().933 932 */ 934 933 public function test_bbp_display_topics_feed_rss2() { 935 // Remove the following lines when you implement this test. 936 $this->markTestIncomplete( 937 'This test has not been implemented yet.' 938 ); 934 require_once dirname( __DIR__, 3 ) . '/includes/feed-rss2-test.php'; 935 936 $feed = new DOMDocument(); 937 $xml = bbp_test_run_feed_rss2( 'topics' ); 938 $valid = $feed->loadXML( $xml ); 939 $this->assertTrue( $valid, $xml ); 940 941 $items = $feed->getElementsByTagName( 'item' ); 942 $this->assertSame( 2, $items->length ); 943 $by_title = array(); 944 foreach ( $items as $item ) { 945 $title = $item->getElementsByTagName( 'title' )->item( 0 )->textContent; 946 $by_title[ $title ] = $item; 947 } 948 $this->assertArrayHasKey( 'Feed Test Topic', $by_title ); 949 $this->assertArrayHasKey( 'Protected Feed Topic', $by_title ); 950 $this->assertStringContainsString( 'Feed test topic content', $by_title['Feed Test Topic']->textContent ); 951 $this->assertSame( 0, $by_title['Protected Feed Topic']->getElementsByTagName( 'description' )->length ); 952 $this->assertStringNotContainsString( 'Protected topic secret content', $xml ); 939 953 } 940 954
Note:
See TracChangeset
for help on using the changeset viewer.