@@ -31,29 +31,29 @@ public function data_provider_invalid_arguments_for_webp_uploads_generate_additi
3131
3232 add_filter ( 'wp_image_editors ' , '__return_empty_array ' );
3333 yield 'when no editor is present ' => array (
34- self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
34+ $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
3535 'medium ' ,
3636 array (),
3737 'image/avif ' ,
3838 );
3939
4040 remove_filter ( 'wp_image_editors ' , '__return_empty_array ' );
4141 yield 'when using a mime that is not supported ' => array (
42- self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
42+ $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
4343 'medium ' ,
4444 array (),
4545 'image/avif ' ,
4646 );
4747
4848 yield 'when no dimension is provided ' => array (
49- self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
49+ $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
5050 'medium ' ,
5151 array (),
5252 'image/webp ' ,
5353 );
5454
5555 yield 'when both dimensions are negative numbers ' => array (
56- self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
56+ $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
5757 'medium ' ,
5858 array (
5959 'width ' => -10 ,
@@ -63,7 +63,7 @@ public function data_provider_invalid_arguments_for_webp_uploads_generate_additi
6363 );
6464
6565 yield 'when both dimensions are zero ' => array (
66- self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
66+ $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' ),
6767 'medium ' ,
6868 array (
6969 'width ' => 0 ,
@@ -82,7 +82,7 @@ public function it_should_create_an_image_with_the_default_suffix_in_the_same_lo
8282 // Create JPEG and WebP so that both versions are generated.
8383 $ this ->opt_in_to_jpeg_and_webp ();
8484
85- $ attachment_id = self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
85+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
8686 $ size_data = array (
8787 'width ' => 300 ,
8888 'height ' => 300 ,
@@ -107,7 +107,7 @@ public function it_should_create_an_image_with_the_default_suffix_in_the_same_lo
107107 * @test
108108 */
109109 public function it_should_create_a_file_in_the_specified_location_with_the_specified_name () {
110- $ attachment_id = self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
110+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
111111 $ size_data = array (
112112 'width ' => 300 ,
113113 'height ' => 300 ,
@@ -131,7 +131,7 @@ public function it_should_create_a_file_in_the_specified_location_with_the_speci
131131 * @test
132132 */
133133 public function it_should_prevent_processing_an_image_with_corrupted_metadata ( callable $ callback , $ size ) {
134- $ attachment_id = self :: factory () ->attachment ->create_upload_object (
134+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object (
135135 TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/balloons.webp '
136136 );
137137 $ metadata = wp_get_attachment_metadata ( $ attachment_id );
@@ -175,7 +175,7 @@ function ( $metadata ) {
175175 * @test
176176 */
177177 public function it_should_prevent_to_create_an_image_size_when_attached_file_does_not_exists () {
178- $ attachment_id = self :: factory () ->attachment ->create_upload_object (
178+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object (
179179 TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/leafs.jpg '
180180 );
181181 $ file = get_attached_file ( $ attachment_id );
@@ -199,7 +199,7 @@ public function it_should_prevent_to_create_an_image_size_when_attached_file_doe
199199 * @test
200200 */
201201 public function it_should_prevent_to_create_a_subsize_if_the_image_editor_does_not_exists () {
202- $ attachment_id = self :: factory () ->attachment ->create_upload_object (
202+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object (
203203 TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/leafs.jpg '
204204 );
205205
@@ -216,7 +216,7 @@ public function it_should_prevent_to_create_a_subsize_if_the_image_editor_does_n
216216 * @test
217217 */
218218 public function it_should_prevent_to_upload_a_mime_that_is_not_supported_by_wordpress () {
219- $ attachment_id = self :: factory () ->attachment ->create_upload_object (
219+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object (
220220 TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/leafs.jpg '
221221 );
222222 $ result = webp_uploads_generate_image_size ( $ attachment_id , 'medium ' , 'image/avif ' );
@@ -231,7 +231,7 @@ public function it_should_prevent_to_upload_a_mime_that_is_not_supported_by_word
231231 */
232232 public function it_should_prevent_to_process_an_image_when_the_editor_does_not_support_the_format () {
233233 // Make sure no editor is available.
234- $ attachment_id = self :: factory () ->attachment ->create_upload_object (
234+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object (
235235 TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/leafs.jpg '
236236 );
237237
@@ -255,7 +255,7 @@ function () {
255255 public function it_should_create_an_image_with_filter_webp_uploads_pre_generate_additional_image_source () {
256256 remove_all_filters ( 'webp_uploads_pre_generate_additional_image_source ' );
257257
258- $ attachment_id = self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
258+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
259259
260260 add_filter (
261261 'webp_uploads_pre_generate_additional_image_source ' ,
@@ -289,7 +289,7 @@ function () {
289289 public function it_should_use_filesize_when_filter_webp_uploads_pre_generate_additional_image_source_returns_filesize () {
290290 remove_all_filters ( 'webp_uploads_pre_generate_additional_image_source ' );
291291
292- $ attachment_id = self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
292+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
293293
294294 add_filter (
295295 'webp_uploads_pre_generate_additional_image_source ' ,
@@ -324,7 +324,7 @@ function () {
324324 public function it_should_return_an_error_when_filter_webp_uploads_pre_generate_additional_image_source_returns_wp_error () {
325325 remove_all_filters ( 'webp_uploads_pre_generate_additional_image_source ' );
326326
327- $ attachment_id = self :: factory () ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
327+ $ attachment_id = $ this -> factory ->attachment ->create_upload_object ( TESTS_PLUGIN_DIR . '/tests/testdata/modules/images/car.jpeg ' );
328328
329329 add_filter (
330330 'webp_uploads_pre_generate_additional_image_source ' ,
@@ -547,8 +547,8 @@ private function mock_empty_action( $action ) {
547547 * @test
548548 */
549549 public function it_should_add_original_image_extension_to_the_webp_file_name_to_ensure_it_is_unique ( $ jpeg_image , $ jpg_image ) {
550- $ jpeg_image_attachment_id = self :: factory () ->attachment ->create_upload_object ( $ jpeg_image );
551- $ jpg_image_attachment_id = self :: factory () ->attachment ->create_upload_object ( $ jpg_image );
550+ $ jpeg_image_attachment_id = $ this -> factory ->attachment ->create_upload_object ( $ jpeg_image );
551+ $ jpg_image_attachment_id = $ this -> factory ->attachment ->create_upload_object ( $ jpg_image );
552552
553553 $ size_data = array (
554554 'width ' => 300 ,
0 commit comments