Skip to content

Commit fd477dd

Browse files
committed
gps
1 parent 79eaa14 commit fd477dd

2 files changed

Lines changed: 70 additions & 0 deletions

File tree

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Enqueue\Gps\Tests\Spec;
4+
5+
use Enqueue\Gps\GpsConnectionFactory;
6+
use Enqueue\Gps\GpsContext;
7+
use Interop\Queue\PsrContext;
8+
use Interop\Queue\Spec\SendToTopicAndReceiveNoWaitFromQueueSpec;
9+
10+
class GpsSendToTopicAndReceiveFromQueueTest extends SendToTopicAndReceiveNoWaitFromQueueSpec
11+
{
12+
private $topic;
13+
14+
protected function createContext()
15+
{
16+
return (new GpsConnectionFactory())->createContext();
17+
}
18+
19+
/**
20+
* @param GpsContext $context
21+
*/
22+
protected function createQueue(PsrContext $context, $queueName)
23+
{
24+
$queue = parent::createQueue($context, $queueName);
25+
26+
$context->subscribe($this->topic, $queue);
27+
28+
return $queue;
29+
}
30+
31+
protected function createTopic(PsrContext $context, $topicName)
32+
{
33+
return $this->topic = parent::createTopic($context, $topicName);
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php
2+
3+
namespace Enqueue\Gps\Tests\Spec;
4+
5+
use Enqueue\Gps\GpsConnectionFactory;
6+
use Enqueue\Gps\GpsContext;
7+
use Interop\Queue\PsrContext;
8+
use Interop\Queue\Spec\SendToTopicAndReceiveNoWaitFromQueueSpec;
9+
10+
class GpsSendToTopicAndReceiveNoWaitFromQueueTest extends SendToTopicAndReceiveNoWaitFromQueueSpec
11+
{
12+
private $topic;
13+
14+
protected function createContext()
15+
{
16+
return (new GpsConnectionFactory())->createContext();
17+
}
18+
19+
/**
20+
* @param GpsContext $context
21+
*/
22+
protected function createQueue(PsrContext $context, $queueName)
23+
{
24+
$queue = parent::createQueue($context, $queueName);
25+
26+
$context->subscribe($this->topic, $queue);
27+
28+
return $queue;
29+
}
30+
31+
protected function createTopic(PsrContext $context, $topicName)
32+
{
33+
return $this->topic = parent::createTopic($context, $topicName);
34+
}
35+
}

0 commit comments

Comments
 (0)