Make WordPress Core


Ignore:
Timestamp:
01/29/2020 12:43:23 AM (4 years ago)
Author:
SergeyBiryukov
Message:

Docs: Improve inline comments per the documentation standards.

Includes minor code layout fixes for better readability.

See #48303.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/ajax/Attachments.php

    r46586 r47122  
    11<?php
    22/**
    3  * Admin ajax functions to be tested
     3 * Admin Ajax functions to be tested.
    44 */
    55require_once( ABSPATH . 'wp-admin/includes/ajax-actions.php' );
    66
    77/**
    8  * Testing ajax attachment handling.
     8 * Testing Ajax attachment handling.
    99 *
    1010 * @group ajax
     
    1515     */
    1616    public function test_wp_ajax_send_attachment_to_editor_should_return_an_image() {
    17         // Become an administrator
     17        // Become an administrator.
    1818        $post    = $_POST;
    1919        $user_id = self::factory()->user->create(
     
    3333        $attachment = $this->_make_attachment( $upload );
    3434
    35         // Set up a default request
     35        // Set up a default request.
    3636        $_POST['nonce']      = wp_create_nonce( 'media-send-to-editor' );
    3737        $_POST['html']       = 'Bar Baz';
     
    4545        );
    4646
    47         // Make the request
     47        // Make the request.
    4848        try {
    4949            $this->_handleAjax( 'send-attachment-to-editor' );
     
    5757        $expected = get_image_send_to_editor( $attachment, '', '', 'left', 'http://example.com/', false, 'large', 'Foo bar' );
    5858
    59         // Ensure everything is correct
     59        // Ensure everything is correct.
    6060        $this->assertTrue( $response['success'] );
    6161        $this->assertEquals( $expected, $response['data'] );
     
    6666     */
    6767    public function test_wp_ajax_send_attachment_to_editor_should_return_a_link() {
    68         // Become an administrator
     68        // Become an administrator.
    6969        $post    = $_POST;
    7070        $user_id = self::factory()->user->create(
     
    8484        $attachment = $this->_make_attachment( $upload );
    8585
    86         // Set up a default request
     86        // Set up a default request.
    8787        $_POST['nonce']      = wp_create_nonce( 'media-send-to-editor' );
    8888        $_POST['html']       = 'Bar Baz';
     
    9494        );
    9595
    96         // Make the request
     96        // Make the request.
    9797        try {
    9898            $this->_handleAjax( 'send-attachment-to-editor' );
     
    110110        );
    111111
    112         // Ensure everything is correct
     112        // Ensure everything is correct.
    113113        $this->assertTrue( $response['success'] );
    114114        $this->assertEquals( $expected, $response['data'] );
Note: See TracChangeset for help on using the changeset viewer.