Changeset 52259
- Timestamp:
- 11/27/2021 04:16:15 PM (3 years ago)
- Location:
- trunk/tests/phpunit/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tests/phpunit/tests/l10n.php
r52253 r52259 408 408 $this->factory()->post->create( $args ); 409 409 410 // Effectively ignore the output until retrieving it later via `getActualOutput()`.411 $this->expectOutputRegex( '`.`' );412 413 410 $expect = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do…'; 411 $this->expectOutputRegex( '/' . $expect . '/' ); 412 414 413 wp_dashboard_recent_drafts(); 415 414 416 $actual = $this->getActualOutput(); 417 418 restore_previous_locale(); 419 420 $this->assertMatchesRegularExpression( '/' . $expect . '/', $actual ); 415 restore_previous_locale(); 421 416 } 422 417 … … 437 432 $post = $this->factory()->post->create( $args ); 438 433 439 // Effectively ignore the output until retrieving it later via `getActualOutput()`.440 $this->expectOutputRegex( '`.`' );441 442 434 $expect = 'Lorem ipsum dolor sit amet, consectetur …'; 435 $this->expectOutputRegex( '/' . $expect . '/' ); 436 443 437 wp_dashboard_recent_drafts(); 444 438 445 $actual = $this->getActualOutput(); 446 447 restore_previous_locale(); 448 449 $this->assertMatchesRegularExpression( '/' . $expect . '/', $actual ); 439 restore_previous_locale(); 450 440 } 451 441 … … 466 456 $this->factory()->post->create( $args ); 467 457 468 // Effectively ignore the output until retrieving it later via `getActualOutput()`.469 $this->expectOutputRegex( '`.`' );470 471 458 $expect = str_repeat( 'あ', 40 ) . '…'; 459 $this->expectOutputRegex( '/' . $expect . '/' ); 460 472 461 wp_dashboard_recent_drafts(); 473 462 474 $actual = $this->getActualOutput(); 475 476 restore_previous_locale(); 477 478 $this->assertMatchesRegularExpression( '/' . $expect . '/', $actual ); 463 restore_previous_locale(); 479 464 } 480 465 -
trunk/tests/phpunit/tests/widgets.php
r52173 r52259 612 612 ); 613 613 614 // Effectively ignore the output until retrieving it later via `getActualOutput()`. 615 $this->expectOutputRegex( '`.`' ); 614 $this->expectOutputRegex( '/Test Title/' ); 616 615 617 616 $widget->display_callback( … … 625 624 ); 626 625 627 $actual = $this->getActualOutput();628 629 626 unregister_widget( $widget ); 630 631 $this->assertStringContainsString( 'Test Title', $actual );632 627 } 633 628
Note: See TracChangeset
for help on using the changeset viewer.