diff --git a/features/makepot.feature b/features/makepot.feature index 24672f6..1abb35d 100644 --- a/features/makepot.feature +++ b/features/makepot.feature @@ -3467,6 +3467,77 @@ Feature: Generate a POT file of a WordPress project msgid "anotherkeyword" """ + Scenario: Falls back to bundled schemas when remote schemas cannot be downloaded + Given an empty foo-plugin directory + And a foo-plugin/foo-plugin.php file: + """ + 'application/json' ]; - $options = [ 'halt_on_error' => false ]; - $response = Utils\http_request( 'GET', $url, null, $headers, $options ); + $headers = [ 'Content-Type' => 'application/json' ]; + $options = [ 'halt_on_error' => false ]; + + try { + $response = Utils\http_request( 'GET', $url, null, $headers, $options ); + } catch ( RuntimeException $exception ) { + WP_CLI::debug( "Failed to download from URL {$url}: {$exception->getMessage()}", 'make-pot' ); + return ''; + } if ( ! $response->success