Bitpay\Client\ClientTest::testCreateToken PHP Method

testCreateToken() public method

public testCreateToken ( )
    public function testCreateToken()
    {
        $response = $this->getMockResponse();
        $response->method('getBody')->willReturn(file_get_contents(__DIR__ . '/../../DataFixtures/tokens.json'));
        $adapter = $this->getMockAdapter();
        $adapter->method('sendRequest')->willReturn($response);
        $this->client->setAdapter($adapter);
        $token = $this->client->createToken();
        $this->assertInstanceOf('Bitpay\\TokenInterface', $token);
        $response = $this->getMockResponse();
        $response->method('getBody')->willReturn(file_get_contents(__DIR__ . '/../../DataFixtures/tokens_pairing.json'));
        $token = $this->client->createToken();
        $this->assertInstanceOf('Bitpay\\TokenInterface', $token);
    }