PHP Classes

File: TestCases/POST/SupplementTest.php

Recommend this page to a friend!
  Packages of Ramesh Narayan Jangid (Sharma)   Open Swoole Microservices   TestCases/POST/SupplementTest.php   Download  
File: TestCases/POST/SupplementTest.php
Role: Auxiliary script
Content type: text/plain
Description: Configuration script
Class: Open Swoole Microservices
Implement microservices using Open Swoole
Author: By
Last change: DocBlcck
Copyright
Date: 3 days ago
Size: 1,846 bytes
 

Contents

Class file image Download
<?php

/**
 * TestCases
 * php version 8.3
 *
 * @category TestCases
 * @package Openswoole_Microservices
 * @author Ramesh N. Jangid (Sharma) <polygon.co.in@gmail.com>
 * @copyright © 2026 Ramesh N. Jangid (Sharma)
 * @license MIT https://opensource.org/license/mit
 * @link https://github.com/polygoncoin/Openswoole-Microservices
 * @since Class available since Release 1.0.0
 */

namespace Microservices\TestCases;

use
Microservices\App\Web;

$header = $defaultHeaders;
$header[] = $contentType;
if (isset(
$token)) {
   
$header[] = "Authorization: Bearer {$token}";

   
$params = [
        [
           
'payload-id-1' => 1,
           
'payload-param-1' => 'payload-param-1-value',
           
'sub' => [
               
'sub-payload-id-1' => 1,
               
'sub-payload-param-1' => 'sub-payload-param-1-value'
           
]
        ],
        [
           
'payload-id-1' => 2,
           
'payload-param-1' => 'payload-param-2-value',
           
'sub' => [
               
'sub-payload-id-1' => 1,
               
'sub-payload-param-1' => 'sub-payload-param-1-value'
           
]
        ],
        [
           
'payload-id-1' => 3,
           
'payload-param-1' => 'payload-param-3-value',
           
'sub' => [
               
'sub-payload-id-1' => 2,
               
'sub-payload-param-1' => 'sub-payload-param-2-value'
           
]
        ],
        [
           
'payload-id-1' => 4,
           
'payload-param-1' => 'payload-param-4-value',
           
'sub' => [
               
'sub-payload-id-1' => 1,
               
'sub-payload-param-1' => 'sub-payload-param-1-value'
           
]
        ],
    ];

    return
Web::trigger(
       
homeURL: $homeURL,
       
method: 'POST',
       
route: '/custom/SupplementTest',
       
header: $header,
       
payload: json_encode(value: $params)
    );
}