Skip to content

Commit 4dbdbb5

Browse files
authored
Merge pull request #1371 from JimTools/bugfix/risky-tests
Fixing risky tests
2 parents 48d3303 + 4c232c2 commit 4dbdbb5

File tree

120 files changed

+42
-667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

120 files changed

+42
-667
lines changed

pkg/amqp-bunny/Tests/AmqpConsumerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public function testShouldImplementConsumerInterface()
2727
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
2828
}
2929

30-
public function testCouldBeConstructedWithContextAndQueueAsArguments()
31-
{
32-
new AmqpConsumer($this->createContextMock(), new AmqpQueue('aName'));
33-
}
34-
3530
public function testShouldReturnQueue()
3631
{
3732
$queue = new AmqpQueue('aName');

pkg/amqp-bunny/Tests/AmqpProducerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ class AmqpProducerTest extends TestCase
2424
{
2525
use ClassExtensionTrait;
2626

27-
public function testCouldBeConstructedWithRequiredArguments()
28-
{
29-
new AmqpProducer($this->createBunnyChannelMock(), $this->createContextMock());
30-
}
31-
3227
public function testShouldImplementQueueInteropProducerInterface()
3328
{
3429
$this->assertClassImplements(Producer::class, AmqpProducer::class);

pkg/amqp-bunny/Tests/AmqpSubscriptionConsumerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
1717
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
1818
}
1919

20-
public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
21-
{
22-
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
23-
}
24-
2520
/**
2621
* @return AmqpContext|MockObject
2722
*/

pkg/amqp-ext/Tests/AmqpConsumerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ public function testShouldImplementConsumerInterface()
1919
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
2020
}
2121

22-
public function testCouldBeConstructedWithContextAndQueueAsArguments()
23-
{
24-
new AmqpConsumer($this->createContext(), new AmqpQueue('aName'));
25-
}
26-
2722
/**
2823
* @return MockObject|AmqpContext
2924
*/

pkg/amqp-ext/Tests/AmqpContextTest.php

-12
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,6 @@ public function testShouldImplementQueueInteropContextInterface()
2828
$this->assertClassImplements(Context::class, AmqpContext::class);
2929
}
3030

31-
public function testCouldBeConstructedWithExtChannelAsFirstArgument()
32-
{
33-
new AmqpContext($this->createExtChannelMock());
34-
}
35-
36-
public function testCouldBeConstructedWithExtChannelCallbackFactoryAsFirstArgument()
37-
{
38-
new AmqpContext(function () {
39-
return $this->createExtChannelMock();
40-
});
41-
}
42-
4331
public function testThrowIfNeitherCallbackNorExtChannelAsFirstArgument()
4432
{
4533
$this->expectException(\InvalidArgumentException::class);

pkg/amqp-ext/Tests/AmqpSubscriptionConsumerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
1717
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
1818
}
1919

20-
public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
21-
{
22-
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
23-
}
24-
2520
/**
2621
* @return AmqpContext|MockObject
2722
*/

pkg/async-event-dispatcher/Tests/AsyncProcessorTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,6 @@ public function testShouldImplementProcessorInterface()
2424
$this->assertClassImplements(Processor::class, AsyncProcessor::class);
2525
}
2626

27-
public function testCouldBeConstructedWithRegistryAndProxyEventDispatcher()
28-
{
29-
new AsyncProcessor($this->createRegistryMock(), $this->createProxyEventDispatcherMock());
30-
}
31-
3227
public function testRejectIfMessageMissingEventNameProperty()
3328
{
3429
$processor = new AsyncProcessor($this->createRegistryMock(), $this->createProxyEventDispatcherMock());

pkg/async-event-dispatcher/Tests/PhpSerializerEventTransformerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ public function testShouldImplementEventTransformerInterface()
2121
$this->assertClassImplements(EventTransformer::class, PhpSerializerEventTransformer::class);
2222
}
2323

24-
public function testCouldBeConstructedWithoutAnyArguments()
25-
{
26-
new PhpSerializerEventTransformer($this->createContextStub());
27-
}
28-
2924
public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage()
3025
{
3126
$transformer = new PhpSerializerEventTransformer($this->createContextStub());

pkg/async-event-dispatcher/Tests/SimpleRegistryTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public function testShouldImplementRegistryInterface()
1818
$this->assertClassImplements(Registry::class, SimpleRegistry::class);
1919
}
2020

21-
public function testCouldBeConstructedWithEventsMapAndTransformersMapAsArguments()
22-
{
23-
new SimpleRegistry([], []);
24-
}
25-
2621
public function testShouldAllowGetTransportNameByEventName()
2722
{
2823
$registry = new SimpleRegistry([

pkg/dbal/Tests/DbalConsumerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ public function testShouldImplementConsumerInterface()
2828
$this->assertClassImplements(Consumer::class, DbalConsumer::class);
2929
}
3030

31-
public function testCouldBeConstructedWithRequiredArguments()
32-
{
33-
new DbalConsumer($this->createContextMock(), new DbalDestination('queue'));
34-
}
35-
3631
public function testShouldReturnInstanceOfDestination()
3732
{
3833
$destination = new DbalDestination('queue');

pkg/dbal/Tests/DbalContextTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public function testShouldImplementContextInterface()
2727
$this->assertClassImplements(Context::class, DbalContext::class);
2828
}
2929

30-
public function testCouldBeConstructedWithRequiredArguments()
31-
{
32-
new DbalContext($this->createConnectionMock());
33-
}
34-
3530
public function testCouldBeConstructedWithEmptyConfiguration()
3631
{
3732
$factory = new DbalContext($this->createConnectionMock(), []);

pkg/dbal/Tests/DbalProducerTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ public function testShouldImplementProducerInterface()
2121
$this->assertClassImplements(Producer::class, DbalProducer::class);
2222
}
2323

24-
public function testCouldBeConstructedWithRequiredArguments()
25-
{
26-
new DbalProducer($this->createContextMock());
27-
}
28-
2924
public function testShouldThrowIfDestinationOfInvalidType()
3025
{
3126
$this->expectException(InvalidDestinationException::class);

pkg/dbal/Tests/DbalSubscriptionConsumerTest.php

+3-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public function testShouldImplementSubscriptionConsumerInterface()
2525
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
2626
}
2727

28-
public function testCouldBeConstructedWithDbalContextAsFirstArgument()
29-
{
30-
new DbalSubscriptionConsumer($this->createDbalContextMock());
31-
}
32-
3328
public function testShouldAddConsumerAndCallbackToSubscribersPropertyOnSubscribe()
3429
{
3530
$subscriptionConsumer = new DbalSubscriptionConsumer($this->createDbalContextMock());
@@ -66,6 +61,9 @@ public function testThrowsIfTrySubscribeAnotherConsumerToAlreadySubscribedQueue(
6661
$subscriptionConsumer->subscribe($barConsumer, $barCallback);
6762
}
6863

64+
/**
65+
* @doesNotPerformAssertions
66+
*/
6967
public function testShouldAllowSubscribeSameConsumerAndCallbackSecondTime()
7068
{
7169
$subscriptionConsumer = new DbalSubscriptionConsumer($this->createDbalContextMock());

pkg/dsn/Tests/DsnTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@
88

99
class DsnTest extends TestCase
1010
{
11-
public function testCouldBeConstructedWithDsnAsFirstArgument()
12-
{
13-
Dsn::parseFirst('foo://localhost:1234');
14-
}
15-
1611
public function testThrowsIfSchemePartIsMissing()
1712
{
1813
$this->expectException(\LogicException::class);

pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrineClearIdentityMapExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616

1717
class DoctrineClearIdentityMapExtensionTest extends TestCase
1818
{
19-
public function testCouldBeConstructedWithRequiredArguments()
20-
{
21-
new DoctrineClearIdentityMapExtension($this->createRegistryMock());
22-
}
23-
2419
public function testShouldClearIdentityMap()
2520
{
2621
$manager = $this->createManagerMock();

pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/DoctrinePingConnectionExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@
1717

1818
class DoctrinePingConnectionExtensionTest extends TestCase
1919
{
20-
public function testCouldBeConstructedWithRequiredAttributes()
21-
{
22-
new DoctrinePingConnectionExtension($this->createRegistryMock());
23-
}
24-
2520
public function testShouldNotReconnectIfConnectionIsOK()
2621
{
2722
$connection = $this->createConnectionMock();

pkg/enqueue-bundle/Tests/Unit/Consumption/Extension/ResetServicesExtensionTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@
1616

1717
class ResetServicesExtensionTest extends TestCase
1818
{
19-
public function testCouldBeConstructedWithRequiredArguments()
20-
{
21-
new ResetServicesExtension($this->createResetterMock());
22-
}
2319

2420
public function testItShouldResetServices()
2521
{

pkg/enqueue-bundle/Tests/Unit/DependencyInjection/ConfigurationTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ public function testShouldBeFinal()
2525
$this->assertClassFinal(Configuration::class);
2626
}
2727

28-
public function testCouldBeConstructedWithDebugAsArgument()
29-
{
30-
new Configuration(true);
31-
}
32-
3328
public function testShouldProcessSeveralTransports()
3429
{
3530
$configuration = new Configuration(true);

pkg/enqueue-bundle/Tests/Unit/DependencyInjection/EnqueueExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public function testShouldBeFinal()
3030
$this->assertClassFinal(EnqueueExtension::class);
3131
}
3232

33-
public function testCouldBeConstructedWithoutAnyArguments()
34-
{
35-
new EnqueueExtension();
36-
}
37-
3833
public function testShouldRegisterConnectionFactory()
3934
{
4035
$container = $this->getContainerBuilder(true);

pkg/enqueue-bundle/Tests/Unit/EnqueueBundleTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,4 @@ public function testShouldExtendBundleClass()
1515
{
1616
$this->assertClassExtends(Bundle::class, EnqueueBundle::class);
1717
}
18-
19-
public function testCouldBeConstructedWithoutAnyArguments()
20-
{
21-
new EnqueueBundle();
22-
}
2318
}

pkg/enqueue-bundle/Tests/Unit/Profiler/MessageQueueCollectorTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ public function testShouldExtendDataCollectorClass()
2323
$this->assertClassExtends(DataCollector::class, MessageQueueCollector::class);
2424
}
2525

26-
public function testCouldBeConstructedWithEmptyConstructor()
27-
{
28-
new MessageQueueCollector();
29-
}
30-
3126
public function testShouldReturnExpectedName()
3227
{
3328
$collector = new MessageQueueCollector();

pkg/enqueue/Tests/ArrayProcessorRegistryTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,6 @@ public function testShouldImplementProcessorRegistryInterface()
1818
$this->assertClassImplements(ProcessorRegistryInterface::class, ArrayProcessorRegistry::class);
1919
}
2020

21-
public function testCouldBeConstructedWithoutAnyArgument()
22-
{
23-
new ArrayProcessorRegistry();
24-
}
25-
2621
public function testShouldThrowExceptionIfProcessorIsNotSet()
2722
{
2823
$registry = new ArrayProcessorRegistry();

pkg/enqueue/Tests/Client/ChainExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@ public function testShouldBeFinal()
2929
$this->assertClassFinal(ChainExtension::class);
3030
}
3131

32-
public function testCouldBeConstructedWithExtensionsArray()
33-
{
34-
new ChainExtension([$this->createExtension(), $this->createExtension()]);
35-
}
36-
3732
public function testThrowIfArrayContainsNotExtension()
3833
{
3934
$this->expectException(\LogicException::class);

pkg/enqueue/Tests/Client/ConsumptionExtension/DelayRedeliveredMessageExtensionTest.php

-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,6 @@
2323

2424
class DelayRedeliveredMessageExtensionTest extends TestCase
2525
{
26-
public function testCouldBeConstructedWithRequiredArguments()
27-
{
28-
new DelayRedeliveredMessageExtension($this->createDriverMock(), 12345);
29-
}
3026

3127
public function testShouldSendDelayedMessageAndRejectOriginalMessage()
3228
{

pkg/enqueue/Tests/Client/ConsumptionExtension/ExclusiveCommandExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ public function testShouldBeFinal()
3434
$this->assertClassFinal(ExclusiveCommandExtension::class);
3535
}
3636

37-
public function testCouldBeConstructedWithDriverAsFirstArgument()
38-
{
39-
new ExclusiveCommandExtension($this->createDriverStub());
40-
}
41-
4237
public function testShouldDoNothingIfMessageHasTopicPropertySetOnPreReceive()
4338
{
4439
$message = new NullMessage();

pkg/enqueue/Tests/Client/ConsumptionExtension/FlushSpoolProducerExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ public function testShouldImplementEndExtensionInterface()
3030
$this->assertClassImplements(EndExtensionInterface::class, FlushSpoolProducerExtension::class);
3131
}
3232

33-
public function testCouldBeConstructedWithSpoolProducerAsFirstArgument()
34-
{
35-
new FlushSpoolProducerExtension($this->createSpoolProducerMock());
36-
}
37-
3833
public function testShouldFlushSpoolProducerOnEnd()
3934
{
4035
$producer = $this->createSpoolProducerMock();

pkg/enqueue/Tests/Client/ConsumptionExtension/LogExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,6 @@ public function testShouldSubClassOfLogExtension()
5555
$this->assertClassExtends(\Enqueue\Consumption\Extension\LogExtension::class, LogExtension::class);
5656
}
5757

58-
public function testCouldBeConstructedWithoutAnyArguments()
59-
{
60-
new LogExtension();
61-
}
62-
6358
public function testShouldLogStartOnStart()
6459
{
6560
$logger = $this->createLogger();

pkg/enqueue/Tests/Client/ConsumptionExtension/SetRouterPropertiesExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@ public function testShouldImplementMessageReceivedExtensionInterface()
2727
$this->assertClassImplements(MessageReceivedExtensionInterface::class, SetRouterPropertiesExtension::class);
2828
}
2929

30-
public function testCouldBeConstructedWithRequiredArguments()
31-
{
32-
new SetRouterPropertiesExtension($this->createDriverMock());
33-
}
34-
3530
public function testShouldSetRouterProcessorPropertyIfNotSetAndOnRouterQueue()
3631
{
3732
$config = Config::create('test', '.', '', '', 'router-queue', '', 'router-processor-name');

pkg/enqueue/Tests/Client/ConsumptionExtension/SetupBrokerExtensionTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@ public function testShouldImplementStartExtensionInterface()
2121
$this->assertClassImplements(StartExtensionInterface::class, SetupBrokerExtension::class);
2222
}
2323

24-
public function testCouldBeConstructedWithRequiredArguments()
25-
{
26-
new SetupBrokerExtension($this->createDriverMock());
27-
}
28-
2924
public function testShouldSetupBroker()
3025
{
3126
$logger = new NullLogger();

pkg/enqueue/Tests/Client/DelegateProcessorTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@
1313

1414
class DelegateProcessorTest extends TestCase
1515
{
16-
public function testCouldBeConstructedWithRequiredArguments()
17-
{
18-
new DelegateProcessor($this->createProcessorRegistryMock());
19-
}
20-
2116
public function testShouldThrowExceptionIfProcessorNameIsNotSet()
2217
{
2318
$this->expectException(\LogicException::class);

pkg/enqueue/Tests/Client/DriverFactoryTest.php

-5
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,6 @@ public function testShouldBeFinal()
6161
$this->assertTrue($rc->isFinal());
6262
}
6363

64-
public function testCouldBeConstructedWithoutAnyArguments()
65-
{
66-
new DriverFactory();
67-
}
68-
6964
public function testThrowIfPackageThatSupportSchemeNotInstalled()
7065
{
7166
$scheme = 'scheme5b7aa7d7cd213';

0 commit comments

Comments
 (0)