Changeset 13314
- Timestamp:
- 08/13/2022 08:58:51 AM (2 years ago)
- Location:
- trunk
- Files:
-
- 60 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/.github/workflows/unit-tests.yml
r13297 r13314 2 2 3 3 on: 4 pull_request: 4 5 push: 5 6 branches: [ master ] … … 12 13 fail-fast: false 13 14 matrix: 14 php: ['7.4', '8.0' ]15 php: ['7.4', '8.0', '8.1'] 15 16 wp_version: ['master'] 16 17 include: … … 59 60 composer-options: "--ignore-platform-reqs" 60 61 61 - name: Adjust wp-phpunit version62 run: if [ ${{ env.WP_VERSION }} == '5.7' ]; then composer require --dev "wp-phpunit/wp-phpunit:5.7"; fi63 64 62 - name: Cache node modules 65 63 uses: actions/cache@v2 -
trunk/.gitignore
r12712 r13314 1 1 .DS_Store 2 2 phpunit.xml 3 .phpunit* 3 4 .idea 4 5 .cache … … 18 19 src/vendor 19 20 vendor 21 composer.lock 20 22 21 23 node_modules -
trunk/composer.json
r13285 r13314 27 27 "wiki": "https://codex.buddypress.org/" 28 28 }, 29 "config": { 30 "allow-plugins": { 31 "composer/installers": true, 32 "dealerdirect/phpcodesniffer-composer-installer": true 33 } 34 }, 29 35 "require": { 30 36 "composer/installers": "^1.10.0", … … 32 38 }, 33 39 "require-dev": { 34 "phpcompatibility/phpcompatibility-wp": "^2.1. 0",40 "phpcompatibility/phpcompatibility-wp": "^2.1.3", 35 41 "dealerdirect/phpcodesniffer-composer-installer": "^0.7.1", 36 "squizlabs/php_codesniffer" : "^3. 5.4",37 "wp-coding-standards/wpcs": " *",42 "squizlabs/php_codesniffer" : "^3.6.0", 43 "wp-coding-standards/wpcs": "~2.3.0", 38 44 "wp-phpunit/wp-phpunit": "^6.0", 39 "phpunit/phpunit": "^7.5",40 45 "yoast/phpunit-polyfills": "^1.0.1" 46 }, 47 "scripts": { 48 "test": "@php ./vendor/phpunit/phpunit/phpunit" 41 49 } 42 50 } -
trunk/tests/phpunit/bootstrap.php
r12712 r13314 1 1 <?php 2 const WP_TESTS_PHPUNIT_POLYFILLS_PATH = __DIR__ . '/../../vendor/yoast/phpunit-polyfills'; 2 3 3 4 if ( defined( 'BP_USE_WP_ENV_TESTS' ) ) { -
trunk/tests/phpunit/includes/testcase-emails.php
r10539 r13314 4 4 class BP_UnitTestCase_Emails extends BP_UnitTestCase { 5 5 6 public static function set UpBeforeClass() {7 parent::set UpBeforeClass();6 public static function set_up_before_class() { 7 parent::set_up_before_class(); 8 8 9 9 require_once( buddypress()->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php' ); … … 16 16 } 17 17 18 public static function tear DownAfterClass() {18 public static function tear_down_after_class() { 19 19 $emails = get_posts( array( 20 20 'fields' => 'ids', … … 31 31 } 32 32 33 parent::tear DownAfterClass();33 parent::tear_down_after_class(); 34 34 } 35 35 } -
trunk/tests/phpunit/includes/testcase.php
r13140 r13314 31 31 * @since 3.0.0 32 32 */ 33 public static function set UpBeforeClass() {33 public static function set_up_before_class() { 34 34 global $wpdb; 35 35 … … 49 49 } 50 50 51 public function set Up() {52 parent::set Up();51 public function set_up() { 52 parent::set_up(); 53 53 54 54 /* … … 75 75 } 76 76 77 public function tear Down() {77 public function tear_down() { 78 78 global $wpdb; 79 79 80 80 remove_action( 'bp_blogs_recorded_existing_blogs', array( $this, 'set_autocommit_flag' ) ); 81 81 82 parent::tear Down();82 parent::tear_down(); 83 83 84 84 // If we detect that a COMMIT has been triggered during the test, clean up blog and user fixtures. … … 116 116 $deleted = parent::delete_user( $user_id ); 117 117 118 // When called in tear DownAfterClass(), BP's cleanup functions may no longer be hooked.118 // When called in tear_down_after_class(), BP's cleanup functions may no longer be hooked. 119 119 if ( bp_is_active( 'activity' ) ) { 120 120 bp_activity_remove_all_user_data( $user_id ); … … 126 126 } 127 127 128 function clean_up_global_scope() {128 public function clean_up_global_scope() { 129 129 buddypress()->bp_nav = buddypress()->bp_options_nav = buddypress()->action_variables = buddypress()->canonical_stack = buddypress()->unfiltered_uri = $GLOBALS['bp_unfiltered_uri'] = array(); 130 130 buddypress()->current_component = buddypress()->current_item = buddypress()->current_action = buddypress()->current_member_type = ''; … … 181 181 } 182 182 183 function assertPreConditions() {184 parent::assert PreConditions();183 public function assert_pre_conditions() { 184 parent::assert_pre_conditions(); 185 185 186 186 // Reinit some of the globals that might have been cleared by BP_UnitTestCase::clean_up_global_scope(). … … 189 189 } 190 190 191 function go_to( $url ) {191 public function go_to( $url ) { 192 192 $GLOBALS['bp']->loggedin_user = NULL; 193 193 $GLOBALS['bp']->pages = bp_core_get_directory_pages(); -
trunk/tests/phpunit/testcases/activity/functions/bpActivityGetActions.php
r11809 r13314 9 9 protected $reset_actions_sorted; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 $bp = buddypress(); 14 14 … … 20 20 } 21 21 22 public function tear Down() {23 parent::tear Down();22 public function tear_down() { 23 parent::tear_down(); 24 24 $bp = buddypress(); 25 25 -
trunk/tests/phpunit/testcases/activity/functions/bpActivityGetActionsForContext.php
r11356 r13314 5 5 */ 6 6 class BP_Tests_Activity_Functions_BpActivityGetActionsForContext extends BP_UnitTestCase { 7 public function set Up() {8 parent::set Up();7 public function set_up() { 8 parent::set_up(); 9 9 10 10 $bp = buddypress(); … … 17 17 } 18 18 19 public function tear Down() {19 public function tear_down() { 20 20 $bp = buddypress(); 21 21 … … 28 28 } 29 29 30 parent::tear Down();30 parent::tear_down(); 31 31 } 32 32 -
trunk/tests/phpunit/testcases/activity/notifications.php
r12222 r13314 12 12 protected $a2; 13 13 14 public function set Up() {15 parent::set Up();14 public function set_up() { 15 parent::set_up(); 16 16 $this->current_user = get_current_user_id(); 17 17 $this->u1 = self::factory()->user->create(); … … 23 23 * When updating an activity, the following filter is fired to prevent sending more than one 24 24 * notification. Once we've reached this filter all at_mentions tests fails so we need to 25 * temporarly remove it and restore it in $this->tear Down()25 * temporarly remove it and restore it in $this->tear_down() 26 26 */ 27 27 remove_filter( 'bp_activity_at_name_do_notifications', '__return_false' ); 28 28 } 29 29 30 public function tear Down() {30 public function tear_down() { 31 31 $this->set_current_user( $this->current_user ); 32 parent::tear Down();32 parent::tear_down(); 33 33 34 34 // Restore the filter … … 310 310 $multiple = 'You have 2 new mentions'; 311 311 312 $this->assert Contains( $single, $format_tests['string_single'] );313 $this->assert Contains( $single, $format_tests['array_single']['text'] );314 $this->assert Contains( $multiple, $format_tests['string_multiple'] );315 $this->assert Contains( $multiple, $format_tests['array_multiple']['text'] );312 $this->assertStringContainsString( $single, $format_tests['string_single'] ); 313 $this->assertStringContainsString( $single, $format_tests['array_single']['text'] ); 314 $this->assertStringContainsString( $multiple, $format_tests['string_multiple'] ); 315 $this->assertStringContainsString( $multiple, $format_tests['array_multiple']['text'] ); 316 316 317 317 // Check filters -
trunk/tests/phpunit/testcases/admin/functions.php
r11763 r13314 6 6 protected $old_current_user = 0; 7 7 8 public function set Up() {9 parent::set Up();8 public function set_up() { 9 parent::set_up(); 10 10 $this->old_current_user = get_current_user_id(); 11 11 $this->set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); … … 20 20 } 21 21 22 public function tear Down() {23 parent::tear Down();22 public function tear_down() { 23 parent::tear_down(); 24 24 $this->set_current_user( $this->old_current_user ); 25 25 } -
trunk/tests/phpunit/testcases/blogs/filters.php
r11737 r13314 8 8 protected $custom_post_types; 9 9 10 public function set Up() {11 parent::set Up();10 public function set_up() { 11 parent::set_up(); 12 12 13 13 $this->custom_post_types = array( 'using_old_filter' ); … … 23 23 } 24 24 25 function tear Down() {26 parent::tear Down();25 function tear_down() { 26 parent::tear_down(); 27 27 28 28 $bp = buddypress(); -
trunk/tests/phpunit/testcases/core/avatars.php
r12760 r13314 328 328 ) ); 329 329 330 $this->assert Contains( 'mystery-man-50.jpg', $found );330 $this->assertStringContainsString( 'mystery-man-50.jpg', $found ); 331 331 } 332 332 … … 344 344 ) ); 345 345 346 $this->assert Contains( 'mystery-man-50.jpg', $found );346 $this->assertStringContainsString( 'mystery-man-50.jpg', $found ); 347 347 } 348 348 … … 361 361 remove_filter( 'bp_core_avatar_thumb_width', array( $this, 'filter_thumb_width' ) ); 362 362 363 $this->assert Contains( 'mystery-man.jpg', $found );363 $this->assertStringContainsString( 'mystery-man.jpg', $found ); 364 364 } 365 365 -
trunk/tests/phpunit/testcases/core/caps.php
r12740 r13314 9 9 protected $blog_id; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 14 14 $this->reset_user_id = get_current_user_id(); … … 19 19 } 20 20 21 public function tear Down() {22 parent::tear Down();21 public function tear_down() { 22 parent::tear_down(); 23 23 24 24 $this->set_current_user( $this->reset_user_id ); -
trunk/tests/phpunit/testcases/core/class-bp-attachment.php
r13175 r13314 11 11 private $image_file; 12 12 13 public function set Up() {14 parent::set Up();13 public function set_up() { 14 parent::set_up(); 15 15 add_filter( 'bp_attachment_upload_overrides', array( $this, 'filter_overrides' ), 10, 1 ); 16 16 add_filter( 'upload_dir', array( $this, 'filter_upload_dir' ), 20, 1 ); … … 21 21 } 22 22 23 public function tear Down() {24 parent::tear Down();23 public function tear_down() { 24 parent::tear_down(); 25 25 remove_filter( 'bp_attachment_upload_overrides', array( $this, 'filter_overrides' ), 10 ); 26 26 remove_filter( 'upload_dir', array( $this, 'filter_upload_dir' ), 20 ); -
trunk/tests/phpunit/testcases/core/class-bp-button.php
r11737 r13314 187 187 ) ); 188 188 189 $this->assertI nternalType( 'int',strpos( $b->contents, '<section ' ) );190 $this->assertI nternalType( 'int',strpos( $b->contents, 'class="section-class ' ) );191 $this->assertI nternalType( 'int',strpos( $b->contents, 'id="section-id"' ) );192 $this->assertI nternalType( 'int',strpos( $b->contents, 'data-parent="foo"' ) );193 $this->assertI nternalType( 'int',strpos( $b->contents, '<button ' ) );194 $this->assertI nternalType( 'int',strpos( $b->contents, 'autofocus="autofocus"' ) );195 $this->assertI nternalType( 'int',strpos( $b->contents, 'type="submit"' ) );196 $this->assertI nternalType( 'int',strpos( $b->contents, 'name="my-button"' ) );189 $this->assertIsInt( strpos( $b->contents, '<section ' ) ); 190 $this->assertIsInt( strpos( $b->contents, 'class="section-class ' ) ); 191 $this->assertIsInt( strpos( $b->contents, 'id="section-id"' ) ); 192 $this->assertIsInt( strpos( $b->contents, 'data-parent="foo"' ) ); 193 $this->assertIsInt( strpos( $b->contents, '<button ' ) ); 194 $this->assertIsInt( strpos( $b->contents, 'autofocus="autofocus"' ) ); 195 $this->assertIsInt( strpos( $b->contents, 'type="submit"' ) ); 196 $this->assertIsInt( strpos( $b->contents, 'name="my-button"' ) ); 197 197 } 198 198 … … 216 216 ) ); 217 217 218 $this->assertI nternalType( 'int',strpos( $b->contents, '<section ' ) );219 $this->assertI nternalType( 'int',strpos( $b->contents, 'class="section-class ' ) );220 $this->assertI nternalType( 'int',strpos( $b->contents, 'id="section-id"' ) );221 $this->assertI nternalType( 'int',strpos( $b->contents, 'href="http://example.com"' ) );222 $this->assertI nternalType( 'int',strpos( $b->contents, 'class="link-class"' ) );223 $this->assertI nternalType( 'int',strpos( $b->contents, 'id="link-id"' ) );224 $this->assertI nternalType( 'int',strpos( $b->contents, 'rel="nofollow"' ) );225 $this->assertI nternalType( 'int',strpos( $b->contents, 'title="link-title"' ) );218 $this->assertIsInt( strpos( $b->contents, '<section ' ) ); 219 $this->assertIsInt( strpos( $b->contents, 'class="section-class ' ) ); 220 $this->assertIsInt( strpos( $b->contents, 'id="section-id"' ) ); 221 $this->assertIsInt( strpos( $b->contents, 'href="http://example.com"' ) ); 222 $this->assertIsInt( strpos( $b->contents, 'class="link-class"' ) ); 223 $this->assertIsInt( strpos( $b->contents, 'id="link-id"' ) ); 224 $this->assertIsInt( strpos( $b->contents, 'rel="nofollow"' ) ); 225 $this->assertIsInt( strpos( $b->contents, 'title="link-title"' ) ); 226 226 } 227 227 … … 242 242 ) ); 243 243 244 $this->assertI nternalType( 'int',strpos( $b->contents, '<button class="new-class"' ) );244 $this->assertIsInt( strpos( $b->contents, '<button class="new-class"' ) ); 245 245 } 246 246 -
trunk/tests/phpunit/testcases/core/class-bp-component.php
r12998 r13314 9 9 */ 10 10 class BP_Tests_BP_Component_TestCases extends BP_UnitTestCase { 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 14 14 $bp = buddypress(); -
trunk/tests/phpunit/testcases/core/class-bp-email-recipient.php
r11737 r13314 7 7 protected $u1; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->u1 = self::factory()->user->create( array( -
trunk/tests/phpunit/testcases/core/class-bp-email.php
r11789 r13314 8 8 protected $u2; 9 9 10 public function set Up() {11 parent::set Up();10 public function set_up() { 11 parent::set_up(); 12 12 13 13 $this->u1 = self::factory()->user->create( array( -
trunk/tests/phpunit/testcases/core/class-bp-media-extractor.php
r12840 r13314 59 59 foreach ( array( 'has', 'embeds', 'images', 'links', 'mentions', 'shortcodes', 'audio' ) as $key ) { 60 60 $this->assertArrayHasKey( $key, $media ); 61 $this->assertI nternalType( 'array',$media[ $key ] );61 $this->assertIsArray( $media[ $key ] ); 62 62 } 63 63 64 64 foreach ( $media['has'] as $item ) { 65 $this->assertI nternalType( 'int',$item );65 $this->assertIsInt( $item ); 66 66 } 67 67 68 68 foreach ( $media['links'] as $item ) { 69 69 $this->assertArrayHasKey( 'url', $item ); 70 $this->assertI nternalType( 'string',$item['url'] );70 $this->assertIsString( $item['url'] ); 71 71 $this->assertNotEmpty( $item['url'] ); 72 72 } … … 74 74 foreach ( $media['mentions'] as $item ) { 75 75 $this->assertArrayHasKey( 'name', $item ); 76 $this->assertI nternalType( 'string',$item['name'] );76 $this->assertIsString( $item['name'] ); 77 77 $this->assertNotEmpty( $item['name'] ); 78 78 } … … 80 80 foreach ( $media['images'] as $item ) { 81 81 $this->assertArrayHasKey( 'height', $item ); 82 $this->assertI nternalType( 'int',$item['height'] );82 $this->assertIsInt( $item['height'] ); 83 83 84 84 $this->assertArrayHasKey( 'width', $item ); 85 $this->assertI nternalType( 'int',$item['width'] );85 $this->assertIsInt( $item['width'] ); 86 86 87 87 $this->assertArrayHasKey( 'source', $item ); 88 $this->assertI nternalType( 'string',$item['source'] );88 $this->assertIsString( $item['source'] ); 89 89 $this->assertNotEmpty( $item['source'] ); 90 90 91 91 $this->assertArrayHasKey( 'url', $item ); 92 $this->assertI nternalType( 'string',$item['url'] );92 $this->assertIsString( $item['url'] ); 93 93 $this->assertNotEmpty( $item['url'] ); 94 94 } … … 96 96 foreach ( $media['shortcodes'] as $shortcode_type => $item ) { 97 97 $this->assertArrayHasKey( 'attributes', $item ); 98 $this->assertI nternalType( 'array',$item['attributes'] );98 $this->assertIsArray( $item['attributes'] ); 99 99 100 100 $this->assertArrayHasKey( 'content', $item ); 101 $this->assertI nternalType( 'string',$item['content'] );101 $this->assertIsString( $item['content'] ); 102 102 103 103 $this->assertArrayHasKey( 'type', $item ); 104 $this->assertI nternalType( 'string',$item['type'] );104 $this->assertIsString( $item['type'] ); 105 105 106 106 $this->assertArrayHasKey( 'original', $item ); 107 $this->assertI nternalType( 'string',$item['original'] );107 $this->assertIsString( $item['original'] ); 108 108 } 109 109 110 110 foreach ( $media['embeds'] as $item ) { 111 111 $this->assertArrayHasKey( 'url', $item ); 112 $this->assertI nternalType( 'string',$item['url'] );112 $this->assertIsString( $item['url'] ); 113 113 $this->assertNotEmpty( $item['url'] ); 114 114 } … … 116 116 foreach ( $media['audio'] as $item ) { 117 117 $this->assertArrayHasKey( 'url', $item ); 118 $this->assertI nternalType( 'string',$item['url'] );118 $this->assertIsString( $item['url'] ); 119 119 $this->assertNotEmpty( $item['url'] ); 120 120 121 121 $this->assertArrayHasKey( 'source', $item ); 122 $this->assertI nternalType( 'string',$item['source'] );122 $this->assertIsString( $item['source'] ); 123 123 $this->assertNotEmpty( $item['source'] ); 124 124 } -
trunk/tests/phpunit/testcases/core/class-bp-user-query.php
r13184 r13314 75 75 ) ); 76 76 77 $this->assert Contains( '0 = 1', $q->uid_clauses['where'] );77 $this->assertStringContainsString( '0 = 1', $q->uid_clauses['where'] ); 78 78 } 79 79 … … 86 86 ) ); 87 87 88 $this->assert NotContains( '0 = 1', $q->uid_clauses['where'] );88 $this->assertStringNotContainsString( '0 = 1', $q->uid_clauses['where'] ); 89 89 } 90 90 -
trunk/tests/phpunit/testcases/core/class-bp-walker-nav-menu.php
r12498 r13314 8 8 protected $user_id; 9 9 10 public function set Up() {11 parent::set Up();10 public function set_up() { 11 parent::set_up(); 12 12 13 13 $this->reset_user_id = get_current_user_id(); … … 17 17 } 18 18 19 public function tear Down() {20 parent::tear Down();19 public function tear_down() { 20 parent::tear_down(); 21 21 $this->set_current_user( $this->reset_user_id ); 22 22 } -
trunk/tests/phpunit/testcases/core/functions.php
r13304 r13314 810 810 $link_color = 'style="color: ' . esc_attr( $appearance['highlight_color'] ) . ';'; 811 811 $result = bp_email_add_link_color_to_template( $content, 'template', 'add-content' ); 812 $this->assert Contains( $link_color, $result );812 $this->assertStringContainsString( $link_color, $result ); 813 813 814 814 $content = '<a href="http://example.com" style="display: block">example</a>'; 815 815 $link_color .= 'display: block'; 816 816 $result = bp_email_add_link_color_to_template( $content, 'template', 'add-content' ); 817 $this->assert Contains( $link_color, $result );817 $this->assertStringContainsString( $link_color, $result ); 818 818 } 819 819 -
trunk/tests/phpunit/testcases/core/functions/bpGetRefererPath.php
r9819 r13314 10 10 private $http_referer = ''; 11 11 12 public function set Up() {13 parent::set Up();12 public function set_up() { 13 parent::set_up(); 14 14 15 15 $this->_wp_http_referer = ''; … … 25 25 } 26 26 27 public function tear Down() {27 public function tear_down() { 28 28 if ( isset( $_REQUEST['_wp_http_referer'] ) ) { 29 29 unset( $_REQUEST['_wp_http_referer'] ); … … 42 42 } 43 43 44 parent::tear Down();44 parent::tear_down(); 45 45 } 46 46 -
trunk/tests/phpunit/testcases/core/functions/bpVerifyNonceRequest.php
r11758 r13314 11 11 private $request_uri = ''; 12 12 13 public function set Up() {14 parent::set Up();13 public function set_up() { 14 parent::set_up(); 15 15 16 16 if ( isset( $_SERVER['HTTP_HOST'] ) ) { … … 27 27 } 28 28 29 public function tear Down() {29 public function tear_down() { 30 30 if ( '' !== $this->http_host ) { 31 31 $_SERVER['HTTP_HOST'] = $this->http_host; … … 40 40 } 41 41 42 parent::tear Down();42 parent::tear_down(); 43 43 } 44 44 -
trunk/tests/phpunit/testcases/core/nav/backCompat.php
r11737 r13314 11 11 protected $bp_options_nav; 12 12 13 public function set Up() {14 parent::set Up();13 public function set_up() { 14 parent::set_up(); 15 15 $this->bp_nav = buddypress()->bp_nav; 16 16 $this->bp_options_nav = buddypress()->bp_options_nav; 17 17 } 18 18 19 public function tear Down() {19 public function tear_down() { 20 20 buddypress()->bp_nav = $this->bp_nav; 21 21 buddypress()->bp_options_nav = $this->bp_options_nav; 22 parent::tear Down();22 parent::tear_down(); 23 23 } 24 24 -
trunk/tests/phpunit/testcases/core/suggestions-nonauth.php
r11739 r13314 76 76 } 77 77 78 public static function tear DownAfterClass() {78 public static function tear_down_after_class() { 79 79 foreach ( self::$group_ids as $group_id ) { 80 80 groups_delete_group( $group_id ); -
trunk/tests/phpunit/testcases/core/suggestions.php
r11739 r13314 94 94 } 95 95 96 public static function tear DownAfterClass() {96 public static function tear_down_after_class() { 97 97 foreach ( self::$group_ids as $group_id ) { 98 98 groups_delete_group( $group_id ); … … 110 110 } 111 111 112 public function set Up() {113 parent::set Up();112 public function set_up() { 113 parent::set_up(); 114 114 $this->set_current_user( self::$current_user ); 115 115 } 116 116 117 public function tear Down() {118 parent::tear Down();117 public function tear_down() { 118 parent::tear_down(); 119 119 $this->set_current_user( self::$old_user_id ); 120 120 } … … 392 392 393 393 $this->assertFalse( is_wp_error( $suggestions ) ); 394 $this->assertI nternalType( 'array',$suggestions );394 $this->assertIsArray( $suggestions ); 395 395 $this->assertEmpty( $suggestions ); 396 396 } … … 403 403 404 404 $this->assertFalse( is_wp_error( $suggestion ) ); 405 $this->assertI nternalType( 'array',$suggestion );405 $this->assertIsArray( $suggestion ); 406 406 $this->assertNotEmpty( $suggestion ); 407 407 408 408 $suggestion = array_shift( $suggestion ); 409 409 410 $this->assertI nternalType( 'object',$suggestion );411 $this->assert AttributeNotEmpty( 'image', $suggestion);412 $this->assert AttributeNotEmpty( 'ID', $suggestion);413 $this->assert AttributeNotEmpty( 'name', $suggestion);410 $this->assertIsObject( $suggestion ); 411 $this->assertNotEmpty( $suggestion->image ); 412 $this->assertNotEmpty( $suggestion->ID ); 413 $this->assertNotEmpty( $suggestion->name ); 414 414 } 415 415 … … 421 421 422 422 $this->assertFalse( is_wp_error( $suggestions ) ); 423 $this->assertI nternalType( 'array',$suggestions );423 $this->assertIsArray( $suggestions ); 424 424 $this->assertNotEmpty( $suggestions ); 425 425 426 426 foreach ( $suggestions as $suggestion ) { 427 $this->assertI nternalType( 'object',$suggestion );428 $this->assert AttributeNotEmpty( 'image', $suggestion);429 $this->assert AttributeNotEmpty( 'ID', $suggestion);430 $this->assert AttributeNotEmpty( 'name', $suggestion);427 $this->assertIsObject( $suggestion ); 428 $this->assertNotEmpty( $suggestion->image ); 429 $this->assertNotEmpty( $suggestion->ID ); 430 $this->assertNotEmpty( $suggestion->name ); 431 431 } 432 432 } … … 458 458 459 459 $this->assertFalse( is_wp_error( $suggestion ) ); 460 $this->assertI nternalType( 'array',$suggestion );460 $this->assertIsArray( $suggestion ); 461 461 $this->assertNotEmpty( $suggestion ); 462 462 463 463 $suggestion = array_shift( $suggestion ); 464 464 465 $this->assertI nternalType( 'object',$suggestion );466 $this->assert AttributeInternalType( 'string', 'image', $suggestion);467 $this->assert AttributeInternalType( 'string', 'ID', $suggestion);468 $this->assert AttributeInternalType( 'string', 'name', $suggestion);465 $this->assertIsObject( $suggestion ); 466 $this->assertIsString( $suggestion->image ); 467 $this->assertIsString( $suggestion->ID ); 468 $this->assertIsString( $suggestion->name ); 469 469 } 470 470 -
trunk/tests/phpunit/testcases/core/templateLoader.php
r12726 r13314 7 7 class BP_Tests_Template_Loader_Functions extends BP_UnitTestCase { 8 8 9 public function set Up() {9 public function set_up() { 10 10 if ( version_compare( bp_get_major_wp_version(), '5.5', '<' ) ) { 11 11 $this->markTestSkipped( … … 16 16 add_filter( 'bp_get_template_stack', array( $this, 'template_stack'), 10, 1 ); 17 17 18 parent::set Up();18 parent::set_up(); 19 19 } 20 20 21 public function tear Down() {21 public function tear_down() { 22 22 remove_filter( 'bp_get_template_stack', array( $this, 'template_stack'), 10, 1 ); 23 23 24 parent::tear Down();24 parent::tear_down(); 25 25 } 26 26 -
trunk/tests/phpunit/testcases/friends/functions.php
r12605 r13314 10 10 protected $filter_fired; 11 11 12 public function set Up() {13 parent::set Up();12 public function set_up() { 13 parent::set_up(); 14 14 $this->filter_fired = ''; 15 15 } -
trunk/tests/phpunit/testcases/friends/notifications.php
r11737 r13314 9 9 protected $friend; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 $this->current_user = get_current_user_id(); 14 14 $this->set_current_user( self::factory()->user->create() ); … … 18 18 } 19 19 20 public function tear Down() {21 parent::tear Down();20 public function tear_down() { 21 parent::tear_down(); 22 22 $this->set_current_user( $this->current_user ); 23 23 } -
trunk/tests/phpunit/testcases/groups/class-bp-groups-member.php
r12741 r13314 1498 1498 */ 1499 1499 public function test_total_group_count_should_return_integer() { 1500 $this->assertI nternalType( 'int',BP_Groups_Member::total_group_count( 123 ) );1500 $this->assertIsInt( BP_Groups_Member::total_group_count( 123 ) ); 1501 1501 } 1502 1502 -
trunk/tests/phpunit/testcases/groups/functions/bpGetUserGroups.php
r12433 r13314 9 9 static $groups; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 groups_remove_member( self::$user, self::$groups[2] ); 14 14 } … … 41 41 } 42 42 43 public static function tear DownAfterClass() {43 public static function tear_down_after_class() { 44 44 foreach ( self::$groups as $group ) { 45 45 groups_delete_group( $group ); … … 63 63 64 64 foreach ( $found as $index => $f ) { 65 $this->assertI nternalType( 'int',$index );66 $this->assertI nternalType( 'object',$f );67 $this->assertI nternalType( 'int',$f->group_id );65 $this->assertIsInt( $index ); 66 $this->assertIsObject( $f ); 67 $this->assertIsInt( $f->group_id ); 68 68 $this->assertSame( $index, $f->group_id ); 69 69 } -
trunk/tests/phpunit/testcases/groups/functions/get-group.php
r13103 r13314 7 7 class BP_Tests_Get_Groups_Param extends BP_UnitTestCase { 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 if ( isset( $GLOBALS['groups_template'] ) ) { … … 15 15 } 16 16 17 public function tear Down() {17 public function tear_down() { 18 18 if ( $this->groups_template ) { 19 19 $GLOBALS['groups_template'] = $this->groups_template; 20 20 } 21 21 22 parent::tear Down();22 parent::tear_down(); 23 23 } 24 24 -
trunk/tests/phpunit/testcases/groups/functions/groupsIsUser.php
r12433 r13314 30 30 } 31 31 32 public static function tear DownAfterClass() {32 public static function tear_down_after_class() { 33 33 foreach ( self::$groups as $group ) { 34 34 groups_delete_group( $group ); -
trunk/tests/phpunit/testcases/groups/functions/groupsTotalGroupsForUser.php
r10445 r13314 10 10 */ 11 11 public function test_should_return_integer() { 12 $this->assertI nternalType( 'int',groups_total_groups_for_user( 123 ) );12 $this->assertIsInt( groups_total_groups_for_user( 123 ) ); 13 13 } 14 14 … … 23 23 wp_cache_set( 'bp_total_groups_for_user_123', '321', 'bp' ); 24 24 25 $this->assertI nternalType( 'int',groups_total_groups_for_user( 123 ) );25 $this->assertIsInt( groups_total_groups_for_user( 123 ) ); 26 26 } 27 27 } -
trunk/tests/phpunit/testcases/groups/notifications.php
r12437 r13314 11 11 protected $group; 12 12 13 public function set Up() {14 parent::set Up();13 public function set_up() { 14 parent::set_up(); 15 15 $this->current_user = get_current_user_id(); 16 16 $this->set_current_user( self::factory()->user->create() ); … … 21 21 } 22 22 23 public function tear Down() {24 parent::tear Down();23 public function tear_down() { 24 parent::tear_down(); 25 25 $this->set_current_user( $this->current_user ); 26 26 } -
trunk/tests/phpunit/testcases/groups/template.php
r13097 r13314 6 6 class BP_Tests_Groups_Template extends BP_UnitTestCase { 7 7 8 public function set Up() {9 parent::set Up();8 public function set_up() { 9 parent::set_up(); 10 10 11 11 if ( isset( $GLOBALS['groups_template'] ) ) { … … 14 14 } 15 15 16 public function tear Down() {16 public function tear_down() { 17 17 if ( $this->groups_template ) { 18 18 $GLOBALS['groups_template'] = $this->groups_template; 19 19 } 20 20 21 parent::tear Down();21 parent::tear_down(); 22 22 } 23 23 -
trunk/tests/phpunit/testcases/groups/template/bpGroupStatusMessage.php
r13085 r13314 9 9 private $groups_template = null; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 $this->current_user = bp_loggedin_user_id(); 14 14 $this->set_current_user( 0 ); … … 19 19 } 20 20 21 public function tear Down() {21 public function tear_down() { 22 22 $this->set_current_user( $this->current_user ); 23 23 if ( $this->groups_template ) { … … 25 25 } 26 26 27 parent::tear Down();27 parent::tear_down(); 28 28 } 29 29 -
trunk/tests/phpunit/testcases/groups/template/group-is-visible.php
r13097 r13314 7 7 class BP_Tests_Groups_Template_Is_Visible extends BP_UnitTestCase { 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 if ( isset( $GLOBALS['groups_template'] ) ) { … … 15 15 } 16 16 17 public function tear Down() {17 public function tear_down() { 18 18 if ( $this->groups_template ) { 19 19 $GLOBALS['groups_template'] = $this->groups_template; 20 20 } 21 21 22 parent::tear Down();22 parent::tear_down(); 23 23 } 24 24 -
trunk/tests/phpunit/testcases/groups/types.php
r13309 r13314 8 8 protected static $u1 = null; 9 9 10 public function set Up() {11 parent::set Up();10 public function set_up() { 11 parent::set_up(); 12 12 13 13 buddypress()->groups->types = array(); … … 93 93 public function test_groups_get_type_object_should_return_type_object() { 94 94 bp_groups_register_group_type( 'foo' ); 95 $this->assertI nternalType( 'object',bp_groups_register_group_type( 'foo' ) );95 $this->assertIsObject( bp_groups_register_group_type( 'foo' ) ); 96 96 } 97 97 -
trunk/tests/phpunit/testcases/members/class-bp-signup.php
r13120 r13314 9 9 protected $signup_allowed; 10 10 11 public function set Up() {11 public function set_up() { 12 12 13 13 if ( is_multisite() ) { … … 19 19 } 20 20 21 parent::set Up();22 } 23 24 public function tear Down() {21 parent::set_up(); 22 } 23 24 public function tear_down() { 25 25 if ( is_multisite() ) { 26 26 update_site_option( 'registration', $this->signup_allowed ); … … 29 29 } 30 30 31 parent::tear Down();31 parent::tear_down(); 32 32 } 33 33 -
trunk/tests/phpunit/testcases/members/template/bpGetMemberClass.php
r11737 r13314 27 27 buddypress()->members->types = array(); 28 28 29 $this->assert Contains( 'member-type-bar', $found );30 $this->assert NotContains( 'member-type-foo', $found );29 $this->assertStringContainsString( 'member-type-bar', $found ); 30 $this->assertStringNotContainsString( 'member-type-foo', $found ); 31 31 } 32 32 } -
trunk/tests/phpunit/testcases/members/template/bpGetMemberTypeDirectoryPermalink.php
r10459 r13314 6 6 */ 7 7 class BP_Tests_Members_Template_BpGetMemberTypeDirectoryPermalink extends BP_UnitTestCase { 8 public function set Up() {9 parent::set Up();8 public function set_up() { 9 parent::set_up(); 10 10 11 11 buddypress()->members->types = array(); … … 24 24 remove_filter( 'bp_get_current_member_type', array( $this, 'fake_current_member_type' ) ); 25 25 26 $this->assert Contains( '/type/foo/', $found );26 $this->assertStringContainsString( '/type/foo/', $found ); 27 27 } 28 28 … … 42 42 remove_filter( 'bp_get_current_member_type', array( $this, 'fake_current_member_type' ) ); 43 43 44 $this->assert Contains( '/type/bar/', $found );44 $this->assertStringContainsString( '/type/bar/', $found ); 45 45 } 46 46 -
trunk/tests/phpunit/testcases/members/types.php
r13309 r13314 6 6 */ 7 7 class BP_Tests_Members_Types extends BP_UnitTestCase { 8 public function set Up() {9 parent::set Up();8 public function set_up() { 9 parent::set_up(); 10 10 11 11 buddypress()->members->types = array(); … … 18 18 19 19 public function test_bp_register_member_type_should_return_type_object() { 20 $this->assertI nternalType( 'object',bp_register_member_type( 'foo' ) );20 $this->assertIsObject( bp_register_member_type( 'foo' ) ); 21 21 } 22 22 … … 144 144 public function test_bp_get_member_type_object_should_return_type_object() { 145 145 bp_register_member_type( 'foo' ); 146 $this->assertI nternalType( 'object',bp_get_member_type_object( 'foo' ) );146 $this->assertIsObject( bp_get_member_type_object( 'foo' ) ); 147 147 } 148 148 -
trunk/tests/phpunit/testcases/messages/class.bp-messages-notice.php
r11737 r13314 8 8 protected $old_current_user = 0; 9 9 10 public function set Up() {11 parent::set Up();10 public function set_up() { 11 parent::set_up(); 12 12 $this->old_current_user = get_current_user_id(); 13 13 $this->set_current_user( self::factory()->user->create( array( 'role' => 'administrator' ) ) ); 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/messages/notifications.php
r13112 r13314 9 9 protected $filter_fired; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 14 14 $this->reset_user_id = get_current_user_id(); … … 17 17 } 18 18 19 public function tear Down() {20 parent::tear Down();19 public function tear_down() { 20 parent::tear_down(); 21 21 22 22 $this->set_current_user( $this->reset_user_id ); -
trunk/tests/phpunit/testcases/routing/activity.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/routing/core.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/routing/friends.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/routing/groups.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 buddypress()->members->types = array(); … … 15 15 } 16 16 17 public function tear Down() {18 parent::tear Down();17 public function tear_down() { 18 parent::tear_down(); 19 19 $this->set_current_user( $this->old_current_user ); 20 20 } -
trunk/tests/phpunit/testcases/routing/members.php
r12328 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 buddypress()->members->types = array(); … … 15 15 } 16 16 17 public function tear Down() {17 public function tear_down() { 18 18 $this->set_current_user( $this->old_current_user ); 19 parent::tear Down();19 parent::tear_down(); 20 20 } 21 21 -
trunk/tests/phpunit/testcases/routing/messages.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/routing/root-profiles.php
r11737 r13314 9 9 protected $u; 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 14 14 add_filter( 'bp_core_enable_root_profiles', '__return_true' ); … … 23 23 } 24 24 25 public function tear Down() {26 parent::tear Down();25 public function tear_down() { 26 parent::tear_down(); 27 27 $this->set_current_user( $this->old_current_user ); 28 28 remove_filter( 'bp_core_enable_root_profiles', '__return_true' ); -
trunk/tests/phpunit/testcases/routing/settings.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/routing/xprofile.php
r11737 r13314 7 7 protected $old_current_user = 0; 8 8 9 public function set Up() {10 parent::set Up();9 public function set_up() { 10 parent::set_up(); 11 11 12 12 $this->old_current_user = get_current_user_id(); … … 14 14 } 15 15 16 public function tear Down() {17 parent::tear Down();16 public function tear_down() { 17 parent::tear_down(); 18 18 $this->set_current_user( $this->old_current_user ); 19 19 } -
trunk/tests/phpunit/testcases/xprofile/BP_XProfile_Field/member_types.php
r11737 r13314 11 11 protected $field; 12 12 13 public function set Up() {14 parent::set Up();13 public function set_up() { 14 parent::set_up(); 15 15 bp_register_member_type( 'foo' ); 16 16 bp_register_member_type( 'bar' ); … … 21 21 } 22 22 23 public function tear Down() {23 public function tear_down() { 24 24 buddypress()->members->types = array(); 25 parent::tear Down();25 parent::tear_down(); 26 26 } 27 27 -
trunk/tests/phpunit/testcases/xprofile/activity.php
r12851 r13314 16 16 } 17 17 18 public static function tear DownAfterClass() {18 public static function tear_down_after_class() { 19 19 $d = self::$updated_profile_data; 20 20 -
trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-field-type.php
r12868 r13314 9 9 class BP_Tests_XProfile_Field_Type extends BP_UnitTestCase { 10 10 11 public function set Up() {12 parent::set Up();11 public function set_up() { 12 parent::set_up(); 13 13 14 14 add_filter( 'bp_xprofile_get_field_types', array( $this, 'get_field_types' ) ); 15 15 } 16 16 17 public function tear Down() {18 parent::tear Down();17 public function tear_down() { 18 parent::tear_down(); 19 19 20 20 remove_filter( 'bp_xprofile_get_field_types', array( $this, 'get_field_types' ) ); -
trunk/tests/phpunit/testcases/xprofile/class-bp-xprofile-query.php
r11737 r13314 10 10 protected $users = array(); 11 11 12 public function tear Down() {13 parent::tear Down();12 public function tear_down() { 13 parent::tear_down(); 14 14 $this->group = ''; 15 15 $this->fields = array(); -
trunk/tests/phpunit/testcases/xprofile/functions.php
r13121 r13314 1056 1056 $regex = '#^Hello world this is a test; with, <a href="([^"]+)" rel="nofollow">some</a>, <a href="([^"]+)" rel="nofollow">words</a>$#i'; 1057 1057 1058 $this->assert RegExp( $regex, $output );1058 $this->assertMatchesRegularExpression( $regex, $output ); 1059 1059 unset( $GLOBALS['field'] ); 1060 1060 } … … 1072 1072 $regex = '#^Hello world this is a test with; <a href="([^"]+)" rel="nofollow">some</a>; <a href="([^"]+)" rel="nofollow">words</a>$#i'; 1073 1073 1074 $this->assert RegExp( $regex, $output );1074 $this->assertMatchesRegularExpression( $regex, $output ); 1075 1075 unset( $GLOBALS['field'] ); 1076 1076 }
Note: See TracChangeset
for help on using the changeset viewer.