Skip to content

Commit

Permalink
close everything on tearDown.
Browse files Browse the repository at this point in the history
  • Loading branch information
makasim committed Oct 12, 2017
1 parent 3c2b8ab commit aeedcfd
Show file tree
Hide file tree
Showing 16 changed files with 142 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/Amqp/BasicConsumeBreakOnFalseSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class BasicConsumeBreakOnFalseSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
2 changes: 1 addition & 1 deletion src/Amqp/BasicConsumeFromAllSubscribedQueuesSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class BasicConsumeFromAllSubscribedQueuesSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class BasicConsumeShouldAddConsumerTagOnSubscribeSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class BasicConsumeShouldRemoveConsumerTagOnUnsubscribeSpec extends Test
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
2 changes: 1 addition & 1 deletion src/Amqp/BasicConsumeUntilUnsubscribedSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class BasicConsumeUntilUnsubscribedSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
2 changes: 1 addition & 1 deletion src/Amqp/PreFetchCountSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ abstract class PreFetchCountSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
2 changes: 1 addition & 1 deletion src/Amqp/SendAndReceiveTimestampAsIntegerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ abstract class SendAndReceiveTimestampAsIntegerSpec extends TestCase
*/
private $context;

public function tearDown()
protected function tearDown()
{
if ($this->context) {
$this->context->close();
Expand Down
16 changes: 15 additions & 1 deletion src/SendAndReceiveDelayedMessageFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendAndReceiveDelayedMessageFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$queue = $this->createQueue($context, 'send_and_receive_delayed_message_from_queue_spec');

$consumer = $context->createConsumer($queue);
Expand Down
16 changes: 15 additions & 1 deletion src/SendAndReceivePriorityMessagesFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendAndReceivePriorityMessagesFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$queue = $this->createQueue($context, 'send_and_receive_priority_messages_from_queue_spec');

$consumer = $context->createConsumer($queue);
Expand Down
16 changes: 15 additions & 1 deletion src/SendAndReceiveTimeToLiveMessagesFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendAndReceiveTimeToLiveMessagesFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$queue = $this->createQueue($context, 'send_and_receive_time_to_live_messages_from_queue_spec');

$consumer = $context->createConsumer($queue);
Expand Down
16 changes: 15 additions & 1 deletion src/SendToAndReceiveFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendToAndReceiveFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$queue = $this->createQueue($context, 'send_to_and_receive_from_queue_spec');

$consumer = $context->createConsumer($queue);
Expand Down
16 changes: 15 additions & 1 deletion src/SendToAndReceiveFromTopicSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendToAndReceiveFromTopicSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$topic = $this->createTopic($context, 'send_to_and_receive_from_topic_spec');

$consumer = $context->createConsumer($topic);
Expand Down
16 changes: 15 additions & 1 deletion src/SendToAndReceiveNoWaitFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendToAndReceiveNoWaitFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$queue = $this->createQueue($context, 'send_to_and_receive_no_wait_from_queue_spec');

$consumer = $context->createConsumer($queue);
Expand Down
16 changes: 15 additions & 1 deletion src/SendToAndReceiveNoWaitFromTopicSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,23 @@
*/
abstract class SendToAndReceiveNoWaitFromTopicSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$topic = $this->createTopic($context, 'send_to_and_receive_no_wait_from_topic_spec');

$consumer = $context->createConsumer($topic);
Expand Down
16 changes: 15 additions & 1 deletion src/SendToTopicAndReceiveFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@
*/
abstract class SendToTopicAndReceiveFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$topic = $this->createTopic($context, 'send_to_topic_and_receive_from_queue_spec');
$queue = $this->createQueue($context, 'send_to_topic_and_receive_from_queue_spec');

Expand Down
16 changes: 15 additions & 1 deletion src/SendToTopicAndReceiveNoWaitFromQueueSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,23 @@
*/
abstract class SendToTopicAndReceiveNoWaitFromQueueSpec extends TestCase
{
/**
* @var PsrContext
*/
private $context;

protected function tearDown()
{
if ($this->context) {
$this->context->close();
}

parent::tearDown();
}

public function test()
{
$context = $this->createContext();
$this->context = $context = $this->createContext();
$topic = $this->createTopic($context, 'send_to_topic_and_receive_from_queue_spec');
$queue = $this->createQueue($context, 'send_to_topic_and_receive_from_queue_spec');

Expand Down

0 comments on commit aeedcfd

Please sign in to comment.