Skip to content

Tests to validate request xml payloads #6

@sahanh

Description

@sahanh

I got few unexpected method exceptions when doing API calls (issue #5 ) and since there were no tests to validate actual xml payload, I implemented my own.

https://github.com/sahanh/infusionsoft-php/tree/develop

Here's how an actual service call is validated

class InvoiceServiceTest extends \ServiceTest
{

    public function testCreateBlankOrder()
    {
        $this->ifs->invoices->createBlankOrder(111, 'hello world', new \DateTime('2014-08-08'), 2, 3);
        $this->verifyCall('InvoiceService.createBlankOrder');
    }
}

image

By default the final request will be validated against a preset xml file under tests/Infusionsoft/Api/fixtures, but it can be overridden.

I'm using aspect mock and it requires php 5.4. Thought of sharing it with you guys.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions