HEX
Server: LiteSpeed
System: Linux s917.lon1.mysecurecloudhost.com 4.18.0-477.21.1.lve.1.el8.x86_64 #1 SMP Tue Sep 5 23:08:35 UTC 2023 x86_64
User: assibfaf (3034)
PHP: 7.4.33
Disabled: NONE
Upload Files
File: /home/assibfaf/public_html/vendor/kosatyi/ipsp-php/tests/Ipsp_RequestTest.php
<?php

class Ipsp_RequestTest extends PHPUnit_Framework_TestCase
{
    protected static $formats;
    public static function setUpBeforeClass()
    {
        self::$formats = array(
            'json' => 'application/json',
            'xml'  => 'application/xml',
            'form' => 'application/x-www-form-urlencoded'
        );
    }
    public static function tearDownAfterClass()
    {
        self::$formats = NULL;
    }
    public function testRequest()
    {
        $request = new Ipsp_Request();
        $this->assertInstanceOf( Ipsp_Request::class , $request );
        return $request;
    }
    /**
     * @depends testRequest
     * @param Ipsp_Request $request
     */
    public function testSetFormat($request)
    {
        $request->setFormat('json');
    }
    /**
     * @depends testRequest
     * @param Ipsp_Request $request
     */
    public function testGetContentTypes($request)
    {
        $this->assertArraySubset( self::$formats , $request->getContentTypes() );
    }
    /**
     * @depends testRequest
     * @param Ipsp_Request $request
     */
    public function testDoPost( $request )
    {
        $this->assertEquals('',$request->doPost('_mock_',''));
        $this->assertEquals('',$request->doPost('_mock_', array()));
    }
    /**
     * @depends testRequest
     * @param Ipsp_Request $request
     */
    public function testDoGet( $request )
    {
        $this->assertEquals( '' , $request->doGet('_mock_','') );
        $this->assertEquals( '' , $request->doGet('_mock_', array() ) );
    }
}