Skip to content
Prev Previous commit
Fix spacing whoopsie in tests
  • Loading branch information
hellofromtonya committed Aug 14, 2023
commit fc5c00790e9321e1c4a94ecdd5eed3dc9fc6bf35
Original file line number Diff line number Diff line change
Expand Up @@ -353,12 +353,14 @@ public function data_install_and_uninstall_fonts() {
*/
public function test_install_with_improper_inputs( $font_families, $files = array() ) {
wp_set_current_user( self::$admin_id );

$install_request = new WP_REST_Request( 'POST', '/wp/v2/fonts' );
$font_families_json = json_encode( $font_families );
$install_request->set_param( 'fontFamilies', $font_families_json );
$install_request->set_file_params( $files );

$response = rest_get_server()->dispatch( $install_request );
$this->assertSame( 400, $response->get_status(), 'Response status is not 400 when font face has both donwload_from_url and uploaded_file properties.' );
$this->assertSame( 400, $response->get_status() );
}

/**
Expand All @@ -369,18 +371,15 @@ public function data_install_with_improper_inputs() {
file_put_contents( $temp_file_path1, 'Mocking file content' );

return array(
'not a font families array'
=> array(
'not a font families array' => array(
'font_families' => 'This is not an array',
),

'empty array'
=> array(
'empty array' => array(
'font_families' => array(),
),

'without slug'
=> array(
'without slug' => array(
'font_families' => array(
array(
'fontFamily' => 'Piazzolla',
Expand Down Expand Up @@ -476,7 +475,6 @@ public function data_install_with_improper_inputs() {
),
),
),

);
}
}