Skip to content

Commit 489ae95

Browse files
Fixed integration tests.
1 parent 8623d8e commit 489ae95

4 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/class-tiny-plugin.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ public function add_dashboard_widget() {
454454
plugins_url( '/css/dashboard-widget.css', __FILE__ ),
455455
array(), self::version()
456456
);
457+
457458
wp_register_script( self::NAME .'_dashboard_widget',
458459
plugins_url( '/js/dashboard-widget.js', __FILE__ ),
459460
array(), self::version(), true

src/views/compress-details.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898
} elseif ( Tiny_Image::is_retina( $size_name ) ) {
9999
echo '<em>' . esc_html__( '(WP Retina 2x)', 'tiny-compress-images' ) . '</em>';
100100
} elseif ( $size->resized() ) {
101-
printf( '<em>' . esc_html__( '(resized to %1$dx%1$d)', 'tiny-compress-images' ) . '</em>', $size->meta['output']['width'], $size->meta['output']['height'] );
101+
printf( '<em>' . esc_html__( '(resized to %1$dx%2$d)', 'tiny-compress-images' ) . '</em>', $size->meta['output']['width'], $size->meta['output']['height'] );
102102
}
103103
echo '</td>';
104104

test/integration/DashboardWidgetIntegrationTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public function test_should_show_widget_without_images() {
2828

2929
public function test_should_show_widget_without_optimized_images() {
3030
$this->upload_media( 'test/fixtures/input-example.jpg' );
31+
$this->visit( '/wp-admin/index.php' );
3132
$element = $this->find(
32-
'#tinypng_dashboard_widget #widget-not-optimized p'
33+
'#widget-not-optimized p'
3334
);
3435

3536
$this->assertEquals(
@@ -49,7 +50,7 @@ public function test_should_show_widget_with_some_images_optimized() {
4950
);
5051

5152
$this->assertEquals(
52-
'Hi Admin, you are doing good. With your current settings you can still optimize 4 image sizes from your 2 uploaded JPEG and PNG images. Start the bulk optimization to optimize the remainder of your library.',
53+
'Admin, you are doing good. With your current settings you can still optimize 5 image sizes from your 2 uploaded JPEG and PNG images. Start the bulk optimization to optimize the remainder of your library.',
5354
$element->getText()
5455
);
5556
}
@@ -64,7 +65,7 @@ public function test_should_show_widget_with_all_images_optimized() {
6465
);
6566

6667
$this->assertEquals(
67-
'Hi Admin, great job! Your entire library is optimized!',
68+
'Admin, this is great! Your entire library is optimized!',
6869
$element->getText()
6970
);
7071
}

test/unit/TinyImageTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ public function test_get_optimization_statistics() {
117117
'optimized-library-size' => 328670,
118118
'unoptimized-library-size' => 328670,
119119
'available-for-optimization' => array( array( 'ID' => 1, 'post_title' => 'I am the one and only' ) ),
120+
'display-percentage' => 0.0
120121
),
121122
Tiny_Image::get_optimization_statistics( new Tiny_Settings(), $wpdb_results )
122123
);

0 commit comments

Comments
 (0)