Example #1
0
 function test_paginate_json_in_ten()
 {
     // Create a post example to have content
     $this->factory->post->create_many(20, $this->posts);
     // Check if has wanted fields.
     $api = new WPM_make_API();
     $json = json_decode($api->print_json());
     $this->assertEquals(10, count($json->data));
 }
Example #2
0
<?php

http_response_code(200);
header('Content-Type: application/json');
$api = new WPM_make_API();
echo $api->print_json();