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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 15 additions & 1 deletion
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

Lines changed: 15 additions & 1 deletion
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

Lines changed: 15 additions & 1 deletion
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);

0 commit comments

Comments
 (0)