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

namespace GoCardlessPro\Integration;

class BankAccountDetailsIntegrationTest extends IntegrationTestBase
{
    public function testResourceModelExists()
    {
        $obj = new \GoCardlessPro\Resources\BankAccountDetail(array());
        $this->assertNotNull($obj);
    }
    
    public function testBankAccountDetailsGet()
    {
        $fixture = $this->loadJsonFixture('bank_account_details')->get;
        $this->stub_request($fixture);

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

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

        $this->assertEquals($body->ciphertext, $response->ciphertext);
        $this->assertEquals($body->encrypted_key, $response->encrypted_key);
        $this->assertEquals($body->iv, $response->iv);
        $this->assertEquals($body->protected, $response->protected);
        $this->assertEquals($body->tag, $response->tag);
    

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

    
}
