WordPress.org

Make WordPress Core

Changeset 1037 in tests


Ignore:
Timestamp:
09/21/2012 01:42:13 PM (6 years ago)
Author:
ryan
Message:

Tests for removing negative capabilities. see #WP21786

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/user/capabilities.php

    r904 r1037  
    539539        $this->assertFalse($contributor->has_cap('delete_page', $page));
    540540    }
     541
     542    /*
     543     * @ticket 21786
     544     */
     545    function test_negative_caps() {
     546        $author = new WP_User( $this->factory->user->create( array( 'role' => 'author' ) ) );
     547        $author->add_cap( 'foo', false );
     548        $this->assertTrue ( isset( $author->caps['foo'] ) );
     549        $author->remove_cap( 'foo' );
     550        $this->assertFalse ( isset( $author->caps['foo'] ) );
     551    }
    541552}
Note: See TracChangeset for help on using the changeset viewer.