Make WordPress Core


Ignore:
Timestamp:
06/30/2012 05:48:18 PM (14 years ago)
Author:
maxcutler
Message:

Port the XML-RPC test suite.

Fixes #45.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-testcase/test-xmlrpc-api/test_wp_getPage.php

    r604 r768  
    11<?php
    22
    3 include_once(ABSPATH . WPINC . '/post-thumbnail-template.php');
    4 
    5 class TestXMLRPCServer_wp_getPage extends WPXMLRPCServerTestCase {
     3class TestXMLRPCServer_wp_getPage extends WP_XMLRPC_UnitTestCase {
    64        var $post_data;
    75        var $post_id;
     
    1715                        'post_content' => rand_str( 2000 ),
    1816                        'post_excerpt' => rand_str( 100 ),
    19                         'post_author' => get_user_by( 'login', 'author' )->ID,
     17                        'post_author' => $this->make_user_by_role( 'author' ),
    2018                        'post_date'  => strftime( "%Y-%m-%d %H:%M:%S", $this->post_date_ts ),
    2119                );
     
    3836                $this->knownWPBug(20336);
    3937
    40                 $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'author', 'author' ) );
     38                $this->make_user_by_role( 'editor' );
     39
     40                $result = $this->myxmlrpcserver->wp_getPage( array( 1, 9999, 'editor', 'editor' ) );
    4141                $this->assertInstanceOf( 'IXR_Error', $result );
    4242                $this->assertEquals( 404, $result->code );
     
    4444
    4545        function test_valid_page() {
     46                $this->make_user_by_role( 'editor' );
     47
    4648                $result = $this->myxmlrpcserver->wp_getPage( array( 1, $this->post_id, 'editor', 'editor' ) );
    4749                $this->assertNotInstanceOf( 'IXR_Error', $result );
     
    8183
    8284        function test_date() {
     85                $this->make_user_by_role( 'editor' );
     86
    8387                $result = $this->myxmlrpcserver->wp_getPage( array( 1, $this->post_id, 'editor', 'editor' ) );
    8488                $this->assertNotInstanceOf( 'IXR_Error', $result );
Note: See TracChangeset for help on using the changeset viewer.