Changeset 9957 for trunk/tests/phpunit/testcases/core/caps.php
- Timestamp:
- 06/20/2015 01:54:56 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/tests/phpunit/testcases/core/caps.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/testcases/core/caps.php
r9956 r9957 25 25 } 26 26 27 /** 28 * @ticket BP6501 29 */ 30 public function test_bp_current_user_can_should_respect_blog_id_passed_in_args_array() { 31 if ( ! is_multisite() ) { 32 $this->markTestSkipped( __METHOD__ . ' requires multisite.' ); 33 } 34 35 $b = $this->factory->blog->create(); 36 $u = $this->factory->user->create(); 37 38 $this->set_current_user( $u ); 39 40 add_filter( 'user_has_cap', array( $this, 'grant_cap_foo' ), 10, 2 ); 41 $can = bp_current_user_can( 'foo', array( 'blog_id' => bp_get_root_blog_id() ) ); 42 $cant = bp_current_user_can( 'foo', array( 'blog_id' => $b ) ); 43 remove_filter( 'user_has_cap', array( $this, 'grant_cap_foo' ), 10, 2 ); 44 45 $this->assertTrue( $can ); 46 $this->assertFalse( $cant ); 47 } 48 27 49 public function grant_cap_foo( $allcaps, $caps ) { 28 50 if ( bp_is_root_blog() ) {
Note: See TracChangeset
for help on using the changeset viewer.