Changeset 7353
- Timestamp:
- 11/14/2025 07:39:41 PM (3 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 11 edited
-
.gitignore (modified) (1 diff)
-
.wp-env.json (added)
-
composer.json (modified) (1 diff)
-
package.json (modified) (3 diffs)
-
phpunit.xml.dist (modified) (2 diffs)
-
tests/phpunit/includes/testcase.php (modified) (3 diffs)
-
tests/phpunit/testcases/admin/tools.php (modified) (2 diffs)
-
tests/phpunit/testcases/common/functions.php (modified) (1 diff)
-
tests/phpunit/testcases/common/verify-nonce.php (modified) (2 diffs)
-
tests/phpunit/testcases/replies/template/status.php (modified) (2 diffs)
-
tests/phpunit/testcases/topics/functions/topic.php (modified) (1 diff)
-
tests/phpunit/testcases/users/template/user.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/.gitignore
r7164 r7353 15 15 /phpunit.xml 16 16 /pnpm-lock.yaml 17 .phpunit.result.cache 17 18 18 19 # Output directory. -
trunk/composer.json
r7352 r7353 19 19 "lint": [ 20 20 "@php ./vendor/squizlabs/php_codesniffer/bin/phpcs" 21 ] 21 ], 22 "test": [ 23 "@php ./vendor/bin/phpunit -c phpunit.xml.dist" 24 ], 25 "phpunit": [ 26 "@test" 27 ] 28 }, 29 "config": { 30 "allow-plugins": { 31 "composer/installers": true, 32 "dealerdirect/phpcodesniffer-composer-installer": true 33 } 22 34 } 23 35 } -
trunk/package.json
r7283 r7353 31 31 "@wordpress/browserslist-config": "~2.1.3", 32 32 "@wordpress/stylelint-config": "~22.4.0", 33 "@wordpress/env": "^10.8.0", 33 34 "autoprefixer": "~8.2.0", 34 35 "browserslist": "~4.23.2", … … 49 50 "grunt-rtlcss": "~2.0.2", 50 51 "grunt-sass": "~3.1.0", 51 "grunt-stylelint": "~0. 8.0",52 "grunt-stylelint": "~0.18", 52 53 "grunt-terser": "~2.0.0", 53 54 "grunt-wp-i18n": "~1.0.3", 55 "grunt-composer": "~0.4.5", 54 56 "matchdep": "~2.0.0", 55 57 "node-sass": "~9.0.0", … … 57 59 "postcss-markdown": "~1.2.0", 58 60 "postcss-scss": "~1.0.2", 59 "stylelint": "~1 5.11.0",60 "stylelint-scss": "~ 6.4.1",61 "stylelint": "~14", 62 "stylelint-scss": "~5", 61 63 "terser": "~5.31.3" 64 }, 65 "scripts": { 66 "wp-env": "wp-env", 67 "test-php": "npm run wp-env run cli -- --env-cwd=wp-content/plugins/bbPress composer test" 62 68 } 63 69 } -
trunk/phpunit.xml.dist
r7042 r7353 8 8 > 9 9 <testsuites> 10 <testsuite >10 <testsuite name="bbPress Test Suite"> 11 11 <directory suffix=".php">tests/phpunit/testcases/</directory> 12 12 </testsuite> … … 28 28 <!-- </listener>--> 29 29 <!-- </listeners>--> 30 <filter> 31 <whitelist processUncoveredFilesFromWhitelist="true"> 32 <directory suffix=".php">src</directory> 33 </whitelist> 34 </filter> 30 <coverage> 31 <include> 32 <directory suffix=".php">./src</directory> 33 </include> 34 <exclude> 35 <directory suffix=".php">./tests</directory> 36 <directory suffix=".php">./vendor</directory> 37 </exclude> 38 </coverage> 35 39 </phpunit> -
trunk/tests/phpunit/includes/testcase.php
r6573 r7353 8 8 * Fake WP mail globals, to avoid errors 9 9 */ 10 public static function setUpBeforeClass() {10 public static function setUpBeforeClass(): void { 11 11 add_filter( 'wp_mail', array( 'BBP_UnitTestCase', 'setUp_wp_mail' ) ); 12 12 add_filter( 'wp_mail_from', array( 'BBP_UnitTestCase', 'tearDown_wp_mail' ) ); 13 13 } 14 14 15 public function setUp() {15 public function setUp(): void { 16 16 parent::setUp(); 17 17 … … 31 31 } 32 32 33 public function tearDown() {33 public function tearDown(): void { 34 34 global $wpdb; 35 35 … … 57 57 } 58 58 59 function assertPreConditions() {59 function assertPreConditions(): void { 60 60 parent::assertPreConditions(); 61 61 } -
trunk/tests/phpunit/testcases/admin/tools.php
r6848 r7353 8 8 class BBP_Tests_Admin_Tools extends BBP_UnitTestCase { 9 9 protected $old_current_user = 0; 10 11 public function setUp() { 10 protected $keymaster_id; 11 12 public function setUp(): void { 12 13 parent::setUp(); 13 14 $this->old_current_user = get_current_user_id(); … … 23 24 } 24 25 25 public function tearDown() {26 public function tearDown(): void { 26 27 parent::tearDown(); 27 28 $this->set_current_user( $this->old_current_user ); -
trunk/tests/phpunit/testcases/common/functions.php
r7302 r7353 9 9 class BBP_Tests_Common_Functions extends BBP_UnitTestCase { 10 10 11 protected $old_current_user; 12 protected $moderator_id; 13 protected $keymaster_id; 14 11 15 /** 12 16 * @covers ::bbp_number_format -
trunk/tests/phpunit/testcases/common/verify-nonce.php
r6013 r7353 11 11 private $request_uri = ''; 12 12 13 public function setUp() {13 public function setUp(): void { 14 14 parent::setUp(); 15 15 … … 27 27 } 28 28 29 public function tearDown() {29 public function tearDown(): void { 30 30 $_SERVER['HTTP_HOST'] = $this->http_host; 31 31 -
trunk/tests/phpunit/testcases/replies/template/status.php
r5784 r7353 10 10 class BBP_Tests_Repliess_Template_Status extends BBP_UnitTestCase { 11 11 protected $old_current_user = 0; 12 13 public function setUp() { 12 protected $keymaster_id; 13 14 public function setUp(): void { 14 15 parent::setUp(); 15 16 $this->old_current_user = get_current_user_id(); … … 19 20 } 20 21 21 public function tearDown() {22 public function tearDown(): void { 22 23 parent::tearDown(); 23 24 $this->set_current_user( $this->old_current_user ); -
trunk/tests/phpunit/testcases/topics/functions/topic.php
r7235 r7353 10 10 class BBP_Tests_Topics_Functions_Topic extends BBP_UnitTestCase { 11 11 12 protected $old_current_user; 13 protected $keymaster_id; 14 12 15 /** 13 16 * @group canonical -
trunk/tests/phpunit/testcases/users/template/user.php
r6868 r7353 9 9 class BBP_Tests_Users_Template_User extends BBP_UnitTestCase { 10 10 11 protected $keymaster_userdata; 12 protected $keymaster_id; 11 13 protected $old_current_user = 0; 12 14 13 public function setUp() {15 public function setUp(): void { 14 16 parent::setUp(); 15 17 $this->old_current_user = get_current_user_id(); … … 20 22 } 21 23 22 public function tearDown() {24 public function tearDown(): void { 23 25 parent::tearDown(); 24 26 $this->set_current_user( $this->old_current_user ); … … 38 40 39 41 // Output. 40 $this->expectOutput String( $formatted_value);41 bbp_user_id( $this->keymaster_id );42 $this->expectOutputRegex( '/' . preg_quote($formatted_value, '/') . '/' ); 43 bbp_user_id( $this->keymaster_id ); 42 44 } 43 45
Note: See TracChangeset
for help on using the changeset viewer.