Skip to content

Commit

Permalink
Merge pull request #1371 from JimTools/bugfix/risky-tests
Browse files Browse the repository at this point in the history
Fixing risky tests
  • Loading branch information
makasim authored Jan 17, 2025
2 parents 48d3303 + 4c232c2 commit 4dbdbb5
Show file tree
Hide file tree
Showing 120 changed files with 42 additions and 667 deletions.
5 changes: 0 additions & 5 deletions pkg/amqp-bunny/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
}

public function testCouldBeConstructedWithContextAndQueueAsArguments()
{
new AmqpConsumer($this->createContextMock(), new AmqpQueue('aName'));
}

public function testShouldReturnQueue()
{
$queue = new AmqpQueue('aName');
Expand Down
5 changes: 0 additions & 5 deletions pkg/amqp-bunny/Tests/AmqpProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ class AmqpProducerTest extends TestCase
{
use ClassExtensionTrait;

public function testCouldBeConstructedWithRequiredArguments()
{
new AmqpProducer($this->createBunnyChannelMock(), $this->createContextMock());
}

public function testShouldImplementQueueInteropProducerInterface()
{
$this->assertClassImplements(Producer::class, AmqpProducer::class);
Expand Down
5 changes: 0 additions & 5 deletions pkg/amqp-bunny/Tests/AmqpSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
{
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
}

/**
* @return AmqpContext|MockObject
*/
Expand Down
5 changes: 0 additions & 5 deletions pkg/amqp-ext/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,6 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
}

public function testCouldBeConstructedWithContextAndQueueAsArguments()
{
new AmqpConsumer($this->createContext(), new AmqpQueue('aName'));
}

/**
* @return MockObject|AmqpContext
*/
Expand Down
12 changes: 0 additions & 12 deletions pkg/amqp-ext/Tests/AmqpContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,6 @@ public function testShouldImplementQueueInteropContextInterface()
$this->assertClassImplements(Context::class, AmqpContext::class);
}

public function testCouldBeConstructedWithExtChannelAsFirstArgument()
{
new AmqpContext($this->createExtChannelMock());
}

public function testCouldBeConstructedWithExtChannelCallbackFactoryAsFirstArgument()
{
new AmqpContext(function () {
return $this->createExtChannelMock();
});
}

public function testThrowIfNeitherCallbackNorExtChannelAsFirstArgument()
{
$this->expectException(\InvalidArgumentException::class);
Expand Down
5 changes: 0 additions & 5 deletions pkg/amqp-ext/Tests/AmqpSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
{
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
}

/**
* @return AmqpContext|MockObject
*/
Expand Down
5 changes: 0 additions & 5 deletions pkg/async-event-dispatcher/Tests/AsyncProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public function testShouldImplementProcessorInterface()
$this->assertClassImplements(Processor::class, AsyncProcessor::class);
}

public function testCouldBeConstructedWithRegistryAndProxyEventDispatcher()
{
new AsyncProcessor($this->createRegistryMock(), $this->createProxyEventDispatcherMock());
}

public function testRejectIfMessageMissingEventNameProperty()
{
$processor = new AsyncProcessor($this->createRegistryMock(), $this->createProxyEventDispatcherMock());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public function testShouldImplementEventTransformerInterface()
$this->assertClassImplements(EventTransformer::class, PhpSerializerEventTransformer::class);
}

public function testCouldBeConstructedWithoutAnyArguments()
{
new PhpSerializerEventTransformer($this->createContextStub());
}

public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage()
{
$transformer = new PhpSerializerEventTransformer($this->createContextStub());
Expand Down
5 changes: 0 additions & 5 deletions pkg/async-event-dispatcher/Tests/SimpleRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public function testShouldImplementRegistryInterface()
$this->assertClassImplements(Registry::class, SimpleRegistry::class);
}

public function testCouldBeConstructedWithEventsMapAndTransformersMapAsArguments()
{
new SimpleRegistry([], []);
}

public function testShouldAllowGetTransportNameByEventName()
{
$registry = new SimpleRegistry([
Expand Down
5 changes: 0 additions & 5 deletions pkg/dbal/Tests/DbalConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,6 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, DbalConsumer::class);
}

public function testCouldBeConstructedWithRequiredArguments()
{
new DbalConsumer($this->createContextMock(), new DbalDestination('queue'));
}

public function testShouldReturnInstanceOfDestination()
{
$destination = new DbalDestination('queue');
Expand Down
5 changes: 0 additions & 5 deletions pkg/dbal/Tests/DbalContextTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function testShouldImplementContextInterface()
$this->assertClassImplements(Context::class, DbalContext::class);
}

public function testCouldBeConstructedWithRequiredArguments()
{
new DbalContext($this->createConnectionMock());
}

public function testCouldBeConstructedWithEmptyConfiguration()
{
$factory = new DbalContext($this->createConnectionMock(), []);
Expand Down
5 changes: 0 additions & 5 deletions pkg/dbal/Tests/DbalProducerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public function testShouldImplementProducerInterface()
$this->assertClassImplements(Producer::class, DbalProducer::class);
}

public function testCouldBeConstructedWithRequiredArguments()
{
new DbalProducer($this->createContextMock());
}

public function testShouldThrowIfDestinationOfInvalidType()
{
$this->expectException(InvalidDestinationException::class);
Expand Down
8 changes: 3 additions & 5 deletions pkg/dbal/Tests/DbalSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public function testShouldImplementSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

public function testCouldBeConstructedWithDbalContextAsFirstArgument()
{
new DbalSubscriptionConsumer($this->createDbalContextMock());
}

public function testShouldAddConsumerAndCallbackToSubscribersPropertyOnSubscribe()
{
$subscriptionConsumer = new DbalSubscriptionConsumer($this->createDbalContextMock());
Expand Down Expand Up @@ -66,6 +61,9 @@ public function testThrowsIfTrySubscribeAnotherConsumerToAlreadySubscribedQueue(
$subscriptionConsumer->subscribe($barConsumer, $barCallback);
}

/**
* @doesNotPerformAssertions
*/
public function testShouldAllowSubscribeSameConsumerAndCallbackSecondTime()
{
$subscriptionConsumer = new DbalSubscriptionConsumer($this->createDbalContextMock());
Expand Down
5 changes: 0 additions & 5 deletions pkg/dsn/Tests/DsnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@

class DsnTest extends TestCase
{
public function testCouldBeConstructedWithDsnAsFirstArgument()
{
Dsn::parseFirst('foo://localhost:1234');
}

public function testThrowsIfSchemePartIsMissing()
{
$this->expectException(\LogicException::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@

class DoctrineClearIdentityMapExtensionTest extends TestCase
{
public function testCouldBeConstructedWithRequiredArguments()
{
new DoctrineClearIdentityMapExtension($this->createRegistryMock());
}

public function testShouldClearIdentityMap()
{
$manager = $this->createManagerMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@

class DoctrinePingConnectionExtensionTest extends TestCase
{
public function testCouldBeConstructedWithRequiredAttributes()
{
new DoctrinePingConnectionExtension($this->createRegistryMock());
}

public function testShouldNotReconnectIfConnectionIsOK()
{
$connection = $this->createConnectionMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@

class ResetServicesExtensionTest extends TestCase
{
public function testCouldBeConstructedWithRequiredArguments()
{
new ResetServicesExtension($this->createResetterMock());
}

public function testItShouldResetServices()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ public function testShouldBeFinal()
$this->assertClassFinal(Configuration::class);
}

public function testCouldBeConstructedWithDebugAsArgument()
{
new Configuration(true);
}

public function testShouldProcessSeveralTransports()
{
$configuration = new Configuration(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public function testShouldBeFinal()
$this->assertClassFinal(EnqueueExtension::class);
}

public function testCouldBeConstructedWithoutAnyArguments()
{
new EnqueueExtension();
}

public function testShouldRegisterConnectionFactory()
{
$container = $this->getContainerBuilder(true);
Expand Down
5 changes: 0 additions & 5 deletions pkg/enqueue-bundle/Tests/Unit/EnqueueBundleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,4 @@ public function testShouldExtendBundleClass()
{
$this->assertClassExtends(Bundle::class, EnqueueBundle::class);
}

public function testCouldBeConstructedWithoutAnyArguments()
{
new EnqueueBundle();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ public function testShouldExtendDataCollectorClass()
$this->assertClassExtends(DataCollector::class, MessageQueueCollector::class);
}

public function testCouldBeConstructedWithEmptyConstructor()
{
new MessageQueueCollector();
}

public function testShouldReturnExpectedName()
{
$collector = new MessageQueueCollector();
Expand Down
5 changes: 0 additions & 5 deletions pkg/enqueue/Tests/ArrayProcessorRegistryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public function testShouldImplementProcessorRegistryInterface()
$this->assertClassImplements(ProcessorRegistryInterface::class, ArrayProcessorRegistry::class);
}

public function testCouldBeConstructedWithoutAnyArgument()
{
new ArrayProcessorRegistry();
}

public function testShouldThrowExceptionIfProcessorIsNotSet()
{
$registry = new ArrayProcessorRegistry();
Expand Down
5 changes: 0 additions & 5 deletions pkg/enqueue/Tests/Client/ChainExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,6 @@ public function testShouldBeFinal()
$this->assertClassFinal(ChainExtension::class);
}

public function testCouldBeConstructedWithExtensionsArray()
{
new ChainExtension([$this->createExtension(), $this->createExtension()]);
}

public function testThrowIfArrayContainsNotExtension()
{
$this->expectException(\LogicException::class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@

class DelayRedeliveredMessageExtensionTest extends TestCase
{
public function testCouldBeConstructedWithRequiredArguments()
{
new DelayRedeliveredMessageExtension($this->createDriverMock(), 12345);
}

public function testShouldSendDelayedMessageAndRejectOriginalMessage()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ public function testShouldBeFinal()
$this->assertClassFinal(ExclusiveCommandExtension::class);
}

public function testCouldBeConstructedWithDriverAsFirstArgument()
{
new ExclusiveCommandExtension($this->createDriverStub());
}

public function testShouldDoNothingIfMessageHasTopicPropertySetOnPreReceive()
{
$message = new NullMessage();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ public function testShouldImplementEndExtensionInterface()
$this->assertClassImplements(EndExtensionInterface::class, FlushSpoolProducerExtension::class);
}

public function testCouldBeConstructedWithSpoolProducerAsFirstArgument()
{
new FlushSpoolProducerExtension($this->createSpoolProducerMock());
}

public function testShouldFlushSpoolProducerOnEnd()
{
$producer = $this->createSpoolProducerMock();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,6 @@ public function testShouldSubClassOfLogExtension()
$this->assertClassExtends(\Enqueue\Consumption\Extension\LogExtension::class, LogExtension::class);
}

public function testCouldBeConstructedWithoutAnyArguments()
{
new LogExtension();
}

public function testShouldLogStartOnStart()
{
$logger = $this->createLogger();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,6 @@ public function testShouldImplementMessageReceivedExtensionInterface()
$this->assertClassImplements(MessageReceivedExtensionInterface::class, SetRouterPropertiesExtension::class);
}

public function testCouldBeConstructedWithRequiredArguments()
{
new SetRouterPropertiesExtension($this->createDriverMock());
}

public function testShouldSetRouterProcessorPropertyIfNotSetAndOnRouterQueue()
{
$config = Config::create('test', '.', '', '', 'router-queue', '', 'router-processor-name');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ public function testShouldImplementStartExtensionInterface()
$this->assertClassImplements(StartExtensionInterface::class, SetupBrokerExtension::class);
}

public function testCouldBeConstructedWithRequiredArguments()
{
new SetupBrokerExtension($this->createDriverMock());
}

public function testShouldSetupBroker()
{
$logger = new NullLogger();
Expand Down
5 changes: 0 additions & 5 deletions pkg/enqueue/Tests/Client/DelegateProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,6 @@

class DelegateProcessorTest extends TestCase
{
public function testCouldBeConstructedWithRequiredArguments()
{
new DelegateProcessor($this->createProcessorRegistryMock());
}

public function testShouldThrowExceptionIfProcessorNameIsNotSet()
{
$this->expectException(\LogicException::class);
Expand Down
5 changes: 0 additions & 5 deletions pkg/enqueue/Tests/Client/DriverFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,6 @@ public function testShouldBeFinal()
$this->assertTrue($rc->isFinal());
}

public function testCouldBeConstructedWithoutAnyArguments()
{
new DriverFactory();
}

public function testThrowIfPackageThatSupportSchemeNotInstalled()
{
$scheme = 'scheme5b7aa7d7cd213';
Expand Down
Loading

0 comments on commit 4dbdbb5

Please sign in to comment.