Make WordPress Core

Ticket #16714: 16714-ut.diff

File 16714-ut.diff, 772 bytes (added by ryan, 12 years ago)
  • tests/user/capabilities.php

     
    534534
    535535                _unregister_post_type( 'foobar' );
    536536
     537                register_post_type( 'something', array( 'capabilities' => array( 'edit_posts' => 'draw_somethings' ) ) );
     538                $something = get_post_type_object( 'something' );
     539                $this->assertEquals( 'draw_somethings', $something->cap->edit_posts );
     540                $this->assertEquals( 'draw_somethings', $something->cap->create_posts );
     541
     542                _unregister_post_type( 'something' );
     543
    537544                // Test meta authorization callbacks
    538545                if ( function_exists( 'register_meta') ) {
    539546                        $this->assertTrue( $admin->has_cap('edit_post_meta',  $post) );