Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit c6d9e15

Browse files
Fixing CI and Specs
1 parent ac5a275 commit c6d9e15

7 files changed

+15
-21
lines changed

‎pkg/gps/GpsConnectionFactory.php‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ private function parseDsn(string $dsn): array
9090
$dsn = Dsn::parseFirst($dsn);
9191

9292
if ('gps' !== $dsn->getSchemeProtocol()) {
93-
throw new \LogicException(sprintf(
94-
'The given scheme protocol "%s" is not supported. It must be "gps"',
95-
$dsn->getSchemeProtocol()
96-
));
93+
throw new \LogicException(sprintf('The given scheme protocol "%s" is not supported. It must be "gps"', $dsn->getSchemeProtocol()));
9794
}
9895

9996
$emulatorHost = $dsn->getString('emulatorHost');
@@ -124,7 +121,7 @@ private function defaultConfig(): array
124121
{
125122
return [
126123
'lazy' => true,
127-
'serilalizeToJson' => true
124+
'serilalizeToJson' => true,
128125
];
129126
}
130127
}

‎pkg/gps/GpsContext.php‎

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,7 @@ public function __construct($client, array $options = [])
5252
} elseif (is_callable($client)) {
5353
$this->clientFactory = $client;
5454
} else {
55-
throw new \InvalidArgumentException(sprintf(
56-
'The $client argument must be either %s or callable that returns %s once called.',
57-
PubSubClient::class,
58-
PubSubClient::class
59-
));
55+
throw new \InvalidArgumentException(sprintf('The $client argument must be either %s or callable that returns %s once called.', PubSubClient::class, PubSubClient::class));
6056
}
6157
}
6258

@@ -148,11 +144,7 @@ public function getClient(): PubSubClient
148144
if (false == $this->client) {
149145
$client = call_user_func($this->clientFactory);
150146
if (false == $client instanceof PubSubClient) {
151-
throw new \LogicException(sprintf(
152-
'The factory must return instance of %s. It returned %s',
153-
PubSubClient::class,
154-
is_object($client) ? get_class($client) : gettype($client)
155-
));
147+
throw new \LogicException(sprintf('The factory must return instance of %s. It returned %s', PubSubClient::class, is_object($client) ? get_class($client) : gettype($client)));
156148
}
157149

158150
$this->client = $client;

‎pkg/gps/Tests/GpsConnectionFactoryConfigTest.php‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@ public function testThrowIfDsnCouldNotBeParsed()
4141

4242
/**
4343
* @dataProvider provideConfigs
44-
*
45-
* @param mixed $config
46-
* @param mixed $expectedConfig
4744
*/
4845
public function testShouldParseConfigurationAsExpected($config, $expectedConfig)
4946
{

‎pkg/gps/Tests/GpsConsumerTest.php‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ public function testShouldReceiveMessageNoWait()
131131
->willReturn($client)
132132
;
133133

134+
$context
135+
->expects($this->once())
136+
->method('getOptions')
137+
->willReturn(['serilalizeToJson' => true]);
138+
134139
$consumer = new GpsConsumer($context, new GpsQueue('queue-name'));
135140

136141
$message = $consumer->receiveNoWait();
@@ -171,6 +176,11 @@ public function testShouldReceiveMessage()
171176
->willReturn($client)
172177
;
173178

179+
$context
180+
->expects($this->once())
181+
->method('getOptions')
182+
->willReturn(['serilalizeToJson' => true]);
183+
174184
$consumer = new GpsConsumer($context, new GpsQueue('queue-name'));
175185

176186
$message = $consumer->receive(12345);

‎pkg/gps/Tests/GpsMessageTest.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testCouldBeUnserializedFromJson()
2929

3030
$json = json_encode($message);
3131

32-
//guard
32+
//guard
3333
$this->assertNotEmpty($json);
3434

3535
$unserializedMessage = GpsMessage::jsonUnserialize($json);

‎pkg/gps/Tests/Spec/GpsSendToTopicAndReceiveFromQueueTest.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ protected function createContext()
2323

2424
/**
2525
* @param GpsContext $context
26-
* @param mixed $queueName
2726
*/
2827
protected function createQueue(Context $context, $queueName)
2928
{

‎pkg/gps/Tests/Spec/GpsSendToTopicAndReceiveNoWaitFromQueueTest.php‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ protected function createContext()
2323

2424
/**
2525
* @param GpsContext $context
26-
* @param mixed $queueName
2726
*/
2827
protected function createQueue(Context $context, $queueName)
2928
{

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /