Changeset 14691
- Timestamp:
- 03/10/2026 05:11:01 AM (4 days ago)
- Location:
- sites/trunk
- Files:
-
- 5 edited
-
.github/workflows/unit-tests.yml (modified) (2 diffs)
-
wordpress.org/public_html/wp-content/plugins/handbook/phpunit/bootstrap.php (modified) (2 diffs)
-
wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/handbook.php (modified) (3 diffs)
-
wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php (modified) (2 diffs)
-
wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/template-tags.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/.github/workflows/unit-tests.yml
r14690 r14691 2 2 3 3 on: 4 pull_request: 4 5 push: 5 branches: [ trunk ]6 pull_request:7 6 branches: [ trunk ] 8 7 … … 52 51 working-directory: ${{ matrix.working-directory }} 53 52 run: phpunit ${{ matrix.phpunit-args }} 53 54 # WordPress-dependent PHP tests — require wp-env (Docker). 55 php-wordpress: 56 name: "WP: ${{ matrix.name }}" 57 runs-on: ubuntu-latest 58 strategy: 59 fail-fast: false 60 matrix: 61 include: 62 - name: Handbook Plugin 63 plugin-directory: wordpress.org/public_html/wp-content/plugins/handbook 64 steps: 65 - uses: actions/checkout@v4 66 67 - name: Set up Node.js 68 uses: actions/setup-node@v4 69 with: 70 node-version: 20 71 72 - name: Install wp-env 73 run: npm -g install @wordpress/env 74 75 - name: Start wp-env 76 working-directory: ${{ matrix.plugin-directory }} 77 run: wp-env start 78 79 - name: Install PHPUnit Polyfills 80 working-directory: ${{ matrix.plugin-directory }} 81 run: wp-env run tests-cli composer require --dev yoast/phpunit-polyfills:^4.0 --working-dir=/wordpress-phpunit 82 83 - name: Run PHPUnit 84 working-directory: ${{ matrix.plugin-directory }} 85 run: wp-env run tests-cli --env-cwd=wp-content/plugins/$(basename ${{ matrix.plugin-directory }}) phpunit --no-configuration --bootstrap phpunit/bootstrap.php phpunit/tests/ -
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/bootstrap.php
r10757 r14691 15 15 $_tests_dir = substr( __FILE__, 0, $pos ) . '/tests/phpunit/'; 16 16 } 17 // Check for wp-env test directory. 18 elseif ( ! $_tests_dir && file_exists( '/wordpress-phpunit/includes/functions.php' ) ) { 19 $_tests_dir = '/wordpress-phpunit/'; 20 } 17 21 // Elseif no path yet, assume a temp directory path. 18 22 elseif ( ! $_tests_dir ) { … … 23 27 echo "Could not find $_tests_dir/includes/functions.php\n"; 24 28 exit( 1 ); 29 } 30 31 // Set polyfills path if available (required by WP test suite). 32 if ( ! defined( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH' ) && file_exists( $_tests_dir . '/vendor/yoast/phpunit-polyfills' ) ) { 33 define( 'WP_TESTS_PHPUNIT_POLYFILLS_PATH', $_tests_dir . '/vendor/yoast/phpunit-polyfills' ); 25 34 } 26 35 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/handbook.php
r10774 r14691 18 18 protected $handbook; 19 19 20 public function setUp() {20 public function setUp(): void { 21 21 parent::setup(); 22 22 WPorg_Handbook_Init::init(); … … 26 26 } 27 27 28 public function tearDown() {28 public function tearDown(): void { 29 29 parent::tearDown(); 30 30 … … 456 456 $this->assertTrue( isset( $wp_registered_sidebars[ 'handbook' ] ) ); 457 457 $this->assertSame( 458 [ 'name', 'id', 'description', 'class', 'before_widget', 'after_widget', 'before_title', 'after_title', 'before_sidebar', 'after_sidebar' ],458 [ 'name', 'id', 'description', 'class', 'before_widget', 'after_widget', 'before_title', 'after_title', 'before_sidebar', 'after_sidebar', 'show_in_rest' ], 459 459 array_keys( $wp_registered_sidebars[ 'handbook' ] ) 460 460 ); -
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/init.php
r10773 r14691 5 5 class WPorg_Handbook_Init_Test extends WP_UnitTestCase { 6 6 7 public function setUp() {7 public function setUp(): void { 8 8 parent::setup(); 9 9 … … 11 11 } 12 12 13 public function tearDown() {13 public function tearDown(): void { 14 14 parent::tearDown(); 15 15 -
sites/trunk/wordpress.org/public_html/wp-content/plugins/handbook/phpunit/tests/template-tags.php
r10762 r14691 5 5 class WPorg_Handbook_Template_Tags_Test extends WP_UnitTestCase { 6 6 7 public function setUp() {7 public function setUp(): void { 8 8 parent::setup(); 9 9 … … 11 11 } 12 12 13 public function tearDown() {13 public function tearDown(): void { 14 14 parent::tearDown(); 15 15
Note: See TracChangeset
for help on using the changeset viewer.