<?php
//
// WARNING: Do not edit by hand, this file was generated by Crank:
// https://github.com/gocardless/crank
//

namespace GoCardlessPro\Integration;

class TransferredMandatesIntegrationTest extends IntegrationTestBase
{
    public function testResourceModelExists()
    {
        $obj = new \GoCardlessPro\Resources\TransferredMandate(array());
        $this->assertNotNull($obj);
    }
    
    public function testTransferredMandatesTransferredMandates()
    {
        $fixture = $this->loadJsonFixture('transferred_mandates')->transferred_mandates;
        $this->stub_request($fixture);

        $service = $this->client->transferredMandates();
        $response = call_user_func_array(array($service, 'transferredMandates'), (array)$fixture->url_params);

        $body = $fixture->body->transferred_mandates;
    
        $this->assertInstanceOf('\GoCardlessPro\Resources\TransferredMandate', $response);

        $this->assertEquals($body->encrypted_customer_bank_details, $response->encrypted_customer_bank_details);
        $this->assertEquals($body->encrypted_decryption_key, $response->encrypted_decryption_key);
        $this->assertEquals($body->links, $response->links);
        $this->assertEquals($body->public_key_id, $response->public_key_id);
    

        $expectedPathRegex = $this->extract_resource_fixture_path_regex($fixture);
        $dispatchedRequest = $this->history[0]['request'];
        $this->assertMatchesRegularExpression($expectedPathRegex, $dispatchedRequest->getUri()->getPath());
    }

    
}
