• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
WordPress develop tests

WordPress develop tests

WordPress develop tests a2z

  • Home
  • Plugins
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / Tests_Functions_Deprecated::test_wp_save_image_file_deprecated_with_gd_resource() – Tests that wp_save_image_file() has a deprecated argument when passed a GD resource.

You appear to be a bot. Output may be restricted

Description

Tests that wp_save_image_file() has a deprecated argument when passed a GD resource.

Usage

Tests_Functions_Deprecated::test_wp_save_image_file_deprecated_with_gd_resource();

Parameters

Returns

void

Source

File name: wordpress-develop-tests/phpunit/tests/functions/deprecated.php


Lines:

1 to 14 of 14
  public function test_wp_save_image_file_deprecated_with_gd_resource() {
    // Call wp_save_image_file().
    require_once ABSPATH . 'wp-admin/includes/image-edit.php';
    $file = wp_tempnam();
    $img  = imagecreatefromjpeg( DIR_TESTDATA . '/images/canola.jpg' );
    wp_save_image_file( $file, $img, 'image/jpeg', 1 );
    imagedestroy( $img );
    unlink( $file );

    // Check if the arg was deprecated.
    $check = $this->was_deprecated( 'argument', 'wp_save_image_file' );
    $this->assertNotEmpty( $check );
  }
 

 View on GitHub

Published: 20th March 2022 | Last updated: 20th March 2022

Primary Sidebar

Information

Function name: Tests_Functions_Deprecated::test_wp_save_image_file_deprecated_with_gd_resource
Class ref: Tests_Functions_Deprecated
Plugin ref: WordPress develop tests
Version: 5.9.3
Sourcefile: phpunit/tests/functions/deprecated.php
File ref: phpunit/tests/functions/deprecated.php
Deprecated?: No
API Letters: D,F,T,W

Footer

WordPress develop tests
WordPress develop tests
WordPress develop tests a2z
WordPress 6.4.1
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  develop.wp-a2z.org
© Copyright WordPress develop tests 2014-2023. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites