Skip to:
Content

bbPress.org

Changeset 7826


Ignore:
Timestamp:
10/04/2026 11:38:49 PM (3 weeks ago)
Author:
johnjamesjacoby
Message:

Tests: Complete skipped-test audit.

Run URL assertions on multisite, where they now pass, and correct BuddyPress group test fixtures so nonce and capability paths execute in the intended request context. Document the remaining dynamic group activity limitation.

In trunk, for 2.7.

See #3705.
Fixes #3695.

Location:
trunk/tests/phpunit/testcases
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/extend/buddypress/activity.php

    r7743 r7826  
    614614                // See https://bbpress.trac.wordpress.org/ticket/2794.
    615615                // See https://bbpress.trac.wordpress.org/ticket/3089.
    616                 $this->markTestSkipped( 'Skipping dynamic group activity action tests.' );
     616                $this->markTestSkipped( 'Dynamic actions are not registered for group forum activity; see #3089.' );
    617617
    618618                $g = $this->bp_factory->group->create();
    … …  
    680680                // See https://bbpress.trac.wordpress.org/ticket/2794.
    681681                // See https://bbpress.trac.wordpress.org/ticket/3089.
    682                 $this->markTestSkipped( 'Skipping dynamic group activity action tests.' );
     682                $this->markTestSkipped( 'Dynamic actions are not registered for group forum activity; see #3089.' );
    683683
    684684                $g = $this->bp_factory->group->create();
  • trunk/tests/phpunit/testcases/extend/buddypress/groups.php

    r7723 r7826  
    123123
    124124                $_SERVER['REQUEST_METHOD']     = 'POST';
    125                 $_SERVER['HTTP_HOST']          = wp_parse_url( home_url(), PHP_URL_HOST );
    126                 $_SERVER['REQUEST_URI']        = '/';
     125                $this->set_request_url();
    127126                $_REQUEST['_wpnonce']          = wp_create_nonce( 'groups_edit_save_forum' );
    128127                $_POST['bbp-edit-group-forum'] = '1';
    … …  
    147146
    148147                $_SERVER['REQUEST_METHOD']     = 'POST';
    149                 $_SERVER['HTTP_HOST']          = wp_parse_url( home_url(), PHP_URL_HOST );
    150                 $_SERVER['REQUEST_URI']        = '/';
     148                $this->set_request_url();
    151149                $_REQUEST['_wpnonce']          = wp_create_nonce( 'groups_edit_save_forum' );
    152150                $_POST['bbp-edit-group-forum'] = '1';
    … …  
    678676
    679677        protected function submit_forum_edit( $forum_id, $parent_id ) {
    680                 $home_url             = wp_parse_url( home_url( '/' ) );
    681                 $_SERVER['HTTP_HOST'] = $home_url['host'];
    682 
    683                 if ( isset( $home_url['port'] ) ) {
    684                         $_SERVER['HTTP_HOST'] .= ':' . $home_url['port'];
    685                 }
    686 
    687                 $_SERVER['REQUEST_URI'] = $home_url['path'];
     678                $this->set_request_url();
    688679                $_POST                  = array(
    689680                        'bbp_forum_id'         => $forum_id,
    … …  
    713704
    714705                remove_filter( 'wp_redirect', $prevent_redirect );
     706        }
     707
     708        protected function set_request_url() {
     709                $home_url             = wp_parse_url( home_url( '/' ) );
     710                $_SERVER['HTTP_HOST'] = $home_url['host'];
     711
     712                if ( isset( $home_url['port'] ) ) {
     713                        $_SERVER['HTTP_HOST'] .= ':' . $home_url['port'];
     714                }
     715
     716                $_SERVER['REQUEST_URI'] = $home_url['path'];
    715717        }
    716718
    … …  
    800802                bbp_add_moderator( $forum_id, $moderator_id );
    801803                bbp_update_group_forum_ids( $group_id, array( $forum_id, $post_id ) );
     804                buddypress()->is_single_item = true;
    802805                $this->set_group_context( $group_id, $user_id );
    803806
  • trunk/tests/phpunit/testcases/forums/template/feeds.php

    r5947 r7826  
    1515         */
    1616        public function test_bbp_get_forum_topics_feed_link() {
    17 
    18                 if ( is_multisite() ) {
    19                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    20                 }
    2117
    2218                $f = $this->factory->forum->create( array(
    … …  
    3834        public function test_bbp_get_forum_replies_feed_link() {
    3935
    40                 if ( is_multisite() ) {
    41                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    42                 }
    43 
    4436                $f = $this->factory->forum->create( array(
    4537                        'post_title' => 'Forum 1',
  • trunk/tests/phpunit/testcases/forums/template/forum.php

    r7775 r7826  
    4343         */
    4444        public function test_bbp_get_forum_permalink() {
    45 
    46                 if ( is_multisite() ) {
    47                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    48                 }
    4945
    5046                // Public category.
    … …  
    182178         */
    183179        public function test_bbp_get_forum_freshness_link() {
    184 
    185                 if ( is_multisite() ) {
    186                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    187                 }
    188180
    189181                $now = time();
    … …  
    403395         */
    404396        public function test_bbp_get_forum_freshness_link_with_unpublished_replies() {
    405 
    406                 if ( is_multisite() ) {
    407                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    408                 }
    409397
    410398                $now = time();
  • trunk/tests/phpunit/testcases/forums/template/get-last-thing.php

    r7770 r7826  
    373373         */
    374374        public function test_bbp_get_forum_last_topic_permalink() {
    375                 if ( is_multisite() ) {
    376                         $this->markTestSkipped( 'Skipping URL tests in multisite for now.' );
    377                 }
    378 
    379375                $c = $this->factory->forum->create( array(
    380376                        'forum_meta' => array(
    … …  
    464460         * @covers ::bbp_get_forum_last_topic_author_link        */
    465461        public function test_bbp_get_forum_last_topic_author_link() {
    466                 if ( is_multisite() ) {
    467                         $this->markTestSkipped( 'Skipping URL tests in multisite for now.' );
    468                 }
    469 
    470462                $u = $this->factory->user->create();
    471463
    … …  
    769761         */
    770762        public function test_bbp_get_forum_last_reply_author_link() {
    771                 if ( is_multisite() ) {
    772                         $this->markTestSkipped( 'Skipping URL tests in multisite for now.' );
    773                 }
    774 
    775763                $u = $this->factory->user->create();
    776764
  • trunk/tests/phpunit/testcases/replies/template/reply.php

    r7784 r7826  
    5555         */
    5656        public function test_bbp_get_reply_permalink() {
    57                 if ( is_multisite() ) {
    58                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    59                 }
    6057                $f = $this->factory->forum->create();
    6158                $t = $this->factory->topic->create( array(
    … …  
    8986         */
    9087        public function test_bbp_get_reply_url() {
    91                 if ( is_multisite() ) {
    92                         $this->markTestSkipped( 'Skipping URL tests in multisite for now.' );
    93                 }
    94 
    9588                $f = $this->factory->forum->create();
    9689
  • trunk/tests/phpunit/testcases/topics/template/get-last-thing.php

    r6436 r7826  
    144144         */
    145145        public function test_bbp_get_topic_last_reply_permalink() {
    146                 if ( is_multisite() ) {
    147                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    148                 }
    149 
    150146                $f = $this->factory->forum->create();
    151147
    … …  
    177173         */
    178174        public function test_bbp_get_topic_last_reply_url() {
    179                 if ( is_multisite() ) {
    180                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    181                 }
    182 
    183175                $f = $this->factory->forum->create();
    184176
  • trunk/tests/phpunit/testcases/topics/template/links.php

    r7792 r7826  
    9191        public function test_bbp_get_topic_freshness_link() {
    9292
    93                 if ( is_multisite() ) {
    94                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    95                 }
    96 
    9793                $now = time();
    9894                $post_date    = date( 'Y-m-d H:i:s', $now - 60 * 60 * 100 );
    … …  
    142138         */
    143139        public function test_bbp_get_topic_freshness_link_with_unpublished_replies() {
    144 
    145                 if ( is_multisite() ) {
    146                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    147                 }
    148140
    149141                $now = time();
  • trunk/tests/phpunit/testcases/topics/template/topic.php

    r7783 r7826  
    5353         */
    5454        public function test_bbp_get_topic_permalink() {
    55                 if ( is_multisite() ) {
    56                         $this->markTestSkipped( 'Skipping URL tests in multiste for now.' );
    57                 }
    5855                $f = $this->factory->forum->create();
    5956                $t = $this->factory->topic->create( array(
Note: See TracChangeset for help on using the changeset viewer.