Skip to content

Commit f320884

Browse files
committed
Merge branch 'trunk' into collaboration/table-awareness-object-cache
2 parents 17f51c2 + 00ac218 commit f320884

3 files changed

Lines changed: 41 additions & 33 deletions

File tree

src/wp-admin/includes/image-edit.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ function wp_image_editor( $post_id, $msg = false ) {
6161
<div class="imgedit-panel-content imgedit-panel-tools wp-clearfix">
6262
<div class="imgedit-menu wp-clearfix">
6363
<button type="button" onclick="imageEdit.toggleCropTool( <?php echo "$post_id, '$nonce'"; ?>, this );" aria-expanded="false" aria-controls="imgedit-crop" class="imgedit-crop button disabled" disabled><?php esc_html_e( 'Crop' ); ?></button>
64-
<button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php esc_html_e( 'Scale' ); ?></button>
64+
<button type="button" class="imgedit-scale button" onclick="imageEdit.toggleControls(this);" aria-expanded="false" aria-controls="imgedit-scale"><?php echo esc_html_x( 'Scale', 'verb' ); ?></button>
6565
<div class="imgedit-rotate-menu-container">
6666
<button type="button" aria-controls="imgedit-rotate-menu" class="imgedit-rotate button" aria-expanded="false" onclick="imageEdit.togglePopup(this)" onblur="imageEdit.monitorPopup()"><?php esc_html_e( 'Image Rotation' ); ?></button>
6767
<div id="imgedit-rotate-menu" class="imgedit-popup-menu">
@@ -158,7 +158,7 @@ function wp_image_editor( $post_id, $msg = false ) {
158158
<span class="imgedit-separator" aria-hidden="true">&times;</span>
159159
<label for="imgedit-scale-height-<?php echo $post_id; ?>" class="screen-reader-text"><?php _e( 'scale height' ); ?></label>
160160
<input type="number" step="1" min="0" max="<?php echo $meta['height'] ?? ''; ?>" aria-describedby="imgedit-scale-warn-<?php echo $post_id; ?>" id="imgedit-scale-height-<?php echo $post_id; ?>" onkeyup="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" onblur="imageEdit.scaleChanged(<?php echo $post_id; ?>, 0, this)" value="<?php echo $meta['height'] ?? 0; ?>" />
161-
<button id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary"><?php esc_html_e( 'Scale' ); ?></button>
161+
<button id="imgedit-scale-button" type="button" onclick="imageEdit.action(<?php echo "$post_id, '$nonce'"; ?>, 'scale')" class="button button-primary"><?php echo esc_html_x( 'Scale', 'verb' ); ?></button>
162162
</div>
163163
<span class="imgedit-scale-warn" id="imgedit-scale-warn-<?php echo $post_id; ?>"><span class="dashicons dashicons-warning" aria-hidden="true"></span><?php esc_html_e( 'Images cannot be scaled to a size larger than the original.' ); ?></span>
164164
</fieldset>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
/**
4+
* @group admin
5+
*
6+
* @covers ::update_option_new_admin_email
7+
*/
8+
class Admin_Includes_Misc_UpdateOptionNewAdminEmail_Test extends WP_UnitTestCase {
9+
10+
/**
11+
* @ticket 59520
12+
*/
13+
public function test_new_admin_email_subject_filter() {
14+
// Default value.
15+
$mailer = tests_retrieve_phpmailer_instance();
16+
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
17+
$this->assertSame( '[Test Blog] New Admin Email Address', $mailer->get_sent()->subject );
18+
19+
// Filtered value.
20+
add_filter(
21+
'new_admin_email_subject',
22+
function () {
23+
return 'Filtered Admin Email Address';
24+
},
25+
10,
26+
1
27+
);
28+
29+
$mailer->mock_sent = array();
30+
31+
$mailer = tests_retrieve_phpmailer_instance();
32+
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
33+
$this->assertSame( 'Filtered Admin Email Address', $mailer->get_sent()->subject );
34+
}
35+
}

tests/phpunit/tests/admin/includesMisc.php renamed to tests/phpunit/tests/admin/Admin_Includes_Misc_UrlShorten_Test.php

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22

33
/**
44
* @group admin
5+
*
6+
* @covers ::url_shorten
57
*/
6-
class Tests_Admin_IncludesMisc extends WP_UnitTestCase {
8+
class Admin_Includes_Misc_UrlShorten_Test extends WP_UnitTestCase {
79

8-
/**
9-
* @covers ::url_shorten
10-
*/
11-
public function test_shorten_url() {
10+
public function test_url_shorten() {
1211
$tests = array(
1312
'wordpress\.org/about/philosophy'
1413
=> 'wordpress\.org/about/philosophy', // No longer strips slashes.
@@ -27,30 +26,4 @@ public function test_shorten_url() {
2726
$this->assertSame( $v, url_shorten( $k ) );
2827
}
2928
}
30-
31-
/**
32-
* @ticket 59520
33-
*/
34-
public function test_new_admin_email_subject_filter() {
35-
// Default value.
36-
$mailer = tests_retrieve_phpmailer_instance();
37-
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
38-
$this->assertSame( '[Test Blog] New Admin Email Address', $mailer->get_sent()->subject );
39-
40-
// Filtered value.
41-
add_filter(
42-
'new_admin_email_subject',
43-
function () {
44-
return 'Filtered Admin Email Address';
45-
},
46-
10,
47-
1
48-
);
49-
50-
$mailer->mock_sent = array();
51-
52-
$mailer = tests_retrieve_phpmailer_instance();
53-
update_option_new_admin_email( 'old@example.com', 'new@example.com' );
54-
$this->assertSame( 'Filtered Admin Email Address', $mailer->get_sent()->subject );
55-
}
5629
}

0 commit comments

Comments
 (0)