$httpClient =
$this->
createMock(HttpClientInterface::
class);
$this->
assertEquals( new Connection(['account' => 12345
],
new SqsClient(['endpoint' => 'https://custom-endpoint.tld', 'region' => 'eu-west-1', 'accessKeyId' => null, 'accessKeySecret' => null
], null,
$httpClient)),
Connection::
fromDsn('sqs://default',
['endpoint' => 'https://custom-endpoint.tld', 'account' => 12345
],
$httpClient) );
} public function testFromDsnWithInvalidQueryString() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessageMatches('|Unknown option found in DSN: \[foo\]\. Allowed options are \[buffer_size, |'
);
Connection::
fromDsn('sqs://default?foo=foo'
);
} public function testFromDsnWithInvalidOption() { $this->
expectException(\InvalidArgumentException::
class);
$this->
expectExceptionMessageMatches('|Unknown option found: \[bar\]\. Allowed options are \[buffer_size, |'
);
Connection::
fromDsn('sqs://default',
['bar' => 'bar'
]);
}