Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
noahtallen committed Apr 14, 2022
1 parent 740b64c commit ab1e4cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public function test_patterns_request_succeeds_with_override_source_site() {
* @param object $patterns_from_api_mock A mock object for the block pattern from API class.
* @param array $test_routes An array of strings of routes to test.
*/
public function test_pattern_registration_on_routes( $patterns_from_api_mock, $test_routes ) {
public function multiple_route_pattern_registration( $patterns_from_api_mock, $test_routes ) {
foreach ( $test_routes as $route ) {
$request_mock = $this->createMock( \WP_REST_Request::class );
$request_mock->method( 'get_route' )->willReturn( $route );
Expand Down Expand Up @@ -203,7 +203,7 @@ public function test_load_block_patterns_from_api_runs_in_correct_request_contex
$patterns_mock = $this->createMock( Block_Patterns_From_API::class );
$patterns_mock->expects( $this->exactly( count( $test_routes ) ) )->method( 'register_patterns' );

$this->test_pattern_registration_on_routes( $patterns_mock, $test_routes );
$this->multiple_route_pattern_registration( $patterns_mock, $test_routes );
}

/**
Expand All @@ -228,6 +228,6 @@ public function test_load_block_patterns_from_api_is_skipped_in_wrong_request_co
$patterns_mock = $this->createMock( Block_Patterns_From_API::class );
$patterns_mock->expects( $this->never() )->method( 'register_patterns' );

$this->test_pattern_registration_on_routes( $patterns_mock, $test_routes );
$this->multiple_route_pattern_registration( $patterns_mock, $test_routes );
}
}
3 changes: 2 additions & 1 deletion apps/editing-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
"test:js:update-snapshots": "npx wp-scripts test-unit-js -u --config='jest.config.js' --colors",
"test:js:watch": "npx wp-scripts test-unit-js --config='jest.config.js' --watch --colors",
"test:php": "npx wp-env run phpunit 'phpunit -c /var/www/html/wp-content/plugins/editing-toolkit-plugin/phpunit.xml.dist'",
"wpcom-sync": "./bin/wpcom-watch-and-sync.sh"
"wpcom-sync": "./bin/wpcom-watch-and-sync.sh",
"en": "npx wp-env start --update"
},
"dependencies": {
"@automattic/calypso-analytics": "workspace:^",
Expand Down

0 comments on commit ab1e4cc

Please sign in to comment.