Skip to content

Commit aeedcfd

Browse files
committed
close everything on tearDown.
1 parent 3c2b8ab commit aeedcfd

16 files changed

+142
-16
lines changed

src/Amqp/BasicConsumeBreakOnFalseSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BasicConsumeBreakOnFalseSpec extends TestCase
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/BasicConsumeFromAllSubscribedQueuesSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BasicConsumeFromAllSubscribedQueuesSpec extends TestCase
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/BasicConsumeShouldAddConsumerTagOnSubscribeSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BasicConsumeShouldAddConsumerTagOnSubscribeSpec extends TestCase
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/BasicConsumeShouldRemoveConsumerTagOnUnsubscribeSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BasicConsumeShouldRemoveConsumerTagOnUnsubscribeSpec extends Test
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/BasicConsumeUntilUnsubscribedSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class BasicConsumeUntilUnsubscribedSpec extends TestCase
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/PreFetchCountSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ abstract class PreFetchCountSpec extends TestCase
1818
*/
1919
private $context;
2020

21-
public function tearDown()
21+
protected function tearDown()
2222
{
2323
if ($this->context) {
2424
$this->context->close();

src/Amqp/SendAndReceiveTimestampAsIntegerSpec.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ abstract class SendAndReceiveTimestampAsIntegerSpec extends TestCase
1717
*/
1818
private $context;
1919

20-
public function tearDown()
20+
protected function tearDown()
2121
{
2222
if ($this->context) {
2323
$this->context->close();

src/SendAndReceiveDelayedMessageFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendAndReceiveDelayedMessageFromQueueSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$queue = $this->createQueue($context, 'send_and_receive_delayed_message_from_queue_spec');
1933

2034
$consumer = $context->createConsumer($queue);

src/SendAndReceivePriorityMessagesFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendAndReceivePriorityMessagesFromQueueSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$queue = $this->createQueue($context, 'send_and_receive_priority_messages_from_queue_spec');
1933

2034
$consumer = $context->createConsumer($queue);

src/SendAndReceiveTimeToLiveMessagesFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendAndReceiveTimeToLiveMessagesFromQueueSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$queue = $this->createQueue($context, 'send_and_receive_time_to_live_messages_from_queue_spec');
1933

2034
$consumer = $context->createConsumer($queue);

src/SendToAndReceiveFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendToAndReceiveFromQueueSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$queue = $this->createQueue($context, 'send_to_and_receive_from_queue_spec');
1933

2034
$consumer = $context->createConsumer($queue);

src/SendToAndReceiveFromTopicSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendToAndReceiveFromTopicSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$topic = $this->createTopic($context, 'send_to_and_receive_from_topic_spec');
1933

2034
$consumer = $context->createConsumer($topic);

src/SendToAndReceiveNoWaitFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendToAndReceiveNoWaitFromQueueSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$queue = $this->createQueue($context, 'send_to_and_receive_no_wait_from_queue_spec');
1933

2034
$consumer = $context->createConsumer($queue);

src/SendToAndReceiveNoWaitFromTopicSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,23 @@
1212
*/
1313
abstract class SendToAndReceiveNoWaitFromTopicSpec extends TestCase
1414
{
15+
/**
16+
* @var PsrContext
17+
*/
18+
private $context;
19+
20+
protected function tearDown()
21+
{
22+
if ($this->context) {
23+
$this->context->close();
24+
}
25+
26+
parent::tearDown();
27+
}
28+
1529
public function test()
1630
{
17-
$context = $this->createContext();
31+
$this->context = $context = $this->createContext();
1832
$topic = $this->createTopic($context, 'send_to_and_receive_no_wait_from_topic_spec');
1933

2034
$consumer = $context->createConsumer($topic);

src/SendToTopicAndReceiveFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,23 @@
1313
*/
1414
abstract class SendToTopicAndReceiveFromQueueSpec extends TestCase
1515
{
16+
/**
17+
* @var PsrContext
18+
*/
19+
private $context;
20+
21+
protected function tearDown()
22+
{
23+
if ($this->context) {
24+
$this->context->close();
25+
}
26+
27+
parent::tearDown();
28+
}
29+
1630
public function test()
1731
{
18-
$context = $this->createContext();
32+
$this->context = $context = $this->createContext();
1933
$topic = $this->createTopic($context, 'send_to_topic_and_receive_from_queue_spec');
2034
$queue = $this->createQueue($context, 'send_to_topic_and_receive_from_queue_spec');
2135

src/SendToTopicAndReceiveNoWaitFromQueueSpec.php

+15-1
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,23 @@
1313
*/
1414
abstract class SendToTopicAndReceiveNoWaitFromQueueSpec extends TestCase
1515
{
16+
/**
17+
* @var PsrContext
18+
*/
19+
private $context;
20+
21+
protected function tearDown()
22+
{
23+
if ($this->context) {
24+
$this->context->close();
25+
}
26+
27+
parent::tearDown();
28+
}
29+
1630
public function test()
1731
{
18-
$context = $this->createContext();
32+
$this->context = $context = $this->createContext();
1933
$topic = $this->createTopic($context, 'send_to_topic_and_receive_from_queue_spec');
2034
$queue = $this->createQueue($context, 'send_to_topic_and_receive_from_queue_spec');
2135

0 commit comments

Comments
 (0)