Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing risky tests #1371

Merged
merged 2 commits into from
Jan 17, 2025
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Fixing risky tests
Makring tests that have no assertions with the annotation to suppress
phpunits warning around risky tests

closes 1370
  • Loading branch information
JimTools committed Jan 11, 2025
commit a2177a568596fe17fe464aa370c7cb75f969b08d
3 changes: 3 additions & 0 deletions pkg/amqp-bunny/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithContextAndQueueAsArguments()
{
new AmqpConsumer($this->createContextMock(), new AmqpQueue('aName'));
4 changes: 4 additions & 0 deletions pkg/amqp-bunny/Tests/AmqpProducerTest.php
Original file line number Diff line number Diff line change
@@ -24,6 +24,10 @@ class AmqpProducerTest extends TestCase
{
use ClassExtensionTrait;

/**
* @doesNotPerformAssertions
*/

public function testCouldBeConstructedWithRequiredArguments()
{
new AmqpProducer($this->createBunnyChannelMock(), $this->createContextMock());
3 changes: 3 additions & 0 deletions pkg/amqp-bunny/Tests/AmqpSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
{
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
3 changes: 3 additions & 0 deletions pkg/amqp-ext/Tests/AmqpConsumerTest.php
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, AmqpConsumer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithContextAndQueueAsArguments()
{
new AmqpConsumer($this->createContext(), new AmqpQueue('aName'));
6 changes: 6 additions & 0 deletions pkg/amqp-ext/Tests/AmqpContextTest.php
Original file line number Diff line number Diff line change
@@ -28,11 +28,17 @@ public function testShouldImplementQueueInteropContextInterface()
$this->assertClassImplements(Context::class, AmqpContext::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExtChannelAsFirstArgument()
{
new AmqpContext($this->createExtChannelMock());
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExtChannelCallbackFactoryAsFirstArgument()
{
new AmqpContext(function () {
3 changes: 3 additions & 0 deletions pkg/amqp-ext/Tests/AmqpSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@ public function testShouldImplementQueueInteropSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithAmqpContextAsFirstArgument()
{
new AmqpSubscriptionConsumer($this->createAmqpContextMock());
3 changes: 3 additions & 0 deletions pkg/async-event-dispatcher/Tests/AsyncProcessorTest.php
Original file line number Diff line number Diff line change
@@ -24,6 +24,9 @@ public function testShouldImplementProcessorInterface()
$this->assertClassImplements(Processor::class, AsyncProcessor::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRegistryAndProxyEventDispatcher()
{
new AsyncProcessor($this->createRegistryMock(), $this->createProxyEventDispatcherMock());
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ public function testShouldImplementEventTransformerInterface()
$this->assertClassImplements(EventTransformer::class, PhpSerializerEventTransformer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithoutAnyArguments()
{
new PhpSerializerEventTransformer($this->createContextStub());
3 changes: 3 additions & 0 deletions pkg/async-event-dispatcher/Tests/SimpleRegistryTest.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ public function testShouldImplementRegistryInterface()
$this->assertClassImplements(Registry::class, SimpleRegistry::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithEventsMapAndTransformersMapAsArguments()
{
new SimpleRegistry([], []);
3 changes: 3 additions & 0 deletions pkg/dbal/Tests/DbalConsumerTest.php
Original file line number Diff line number Diff line change
@@ -28,6 +28,9 @@ public function testShouldImplementConsumerInterface()
$this->assertClassImplements(Consumer::class, DbalConsumer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DbalConsumer($this->createContextMock(), new DbalDestination('queue'));
3 changes: 3 additions & 0 deletions pkg/dbal/Tests/DbalContextTest.php
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ public function testShouldImplementContextInterface()
$this->assertClassImplements(Context::class, DbalContext::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DbalContext($this->createConnectionMock());
3 changes: 3 additions & 0 deletions pkg/dbal/Tests/DbalProducerTest.php
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ public function testShouldImplementProducerInterface()
$this->assertClassImplements(Producer::class, DbalProducer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DbalProducer($this->createContextMock());
6 changes: 6 additions & 0 deletions pkg/dbal/Tests/DbalSubscriptionConsumerTest.php
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ public function testShouldImplementSubscriptionConsumerInterface()
$this->assertTrue($rc->implementsInterface(SubscriptionConsumer::class));
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithDbalContextAsFirstArgument()
{
new DbalSubscriptionConsumer($this->createDbalContextMock());
@@ -66,6 +69,9 @@ public function testThrowsIfTrySubscribeAnotherConsumerToAlreadySubscribedQueue(
$subscriptionConsumer->subscribe($barConsumer, $barCallback);
}

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

class DsnTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithDsnAsFirstArgument()
{
Dsn::parseFirst('foo://localhost:1234');
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@

class DoctrineClearIdentityMapExtensionTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DoctrineClearIdentityMapExtension($this->createRegistryMock());
Original file line number Diff line number Diff line change
@@ -17,6 +17,9 @@

class DoctrinePingConnectionExtensionTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredAttributes()
{
new DoctrinePingConnectionExtension($this->createRegistryMock());
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@

class ResetServicesExtensionTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new ResetServicesExtension($this->createResetterMock());
Original file line number Diff line number Diff line change
@@ -25,6 +25,9 @@ public function testShouldBeFinal()
$this->assertClassFinal(Configuration::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithDebugAsArgument()
{
new Configuration(true);
Original file line number Diff line number Diff line change
@@ -30,6 +30,9 @@ public function testShouldBeFinal()
$this->assertClassFinal(EnqueueExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithoutAnyArguments()
{
new EnqueueExtension();
3 changes: 3 additions & 0 deletions pkg/enqueue-bundle/Tests/Unit/EnqueueBundleTest.php
Original file line number Diff line number Diff line change
@@ -16,6 +16,9 @@ public function testShouldExtendBundleClass()
$this->assertClassExtends(Bundle::class, EnqueueBundle::class);
}

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

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithEmptyConstructor()
{
new MessageQueueCollector();
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/ArrayProcessorRegistryTest.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ public function testShouldImplementProcessorRegistryInterface()
$this->assertClassImplements(ProcessorRegistryInterface::class, ArrayProcessorRegistry::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithoutAnyArgument()
{
new ArrayProcessorRegistry();
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/ChainExtensionTest.php
Original file line number Diff line number Diff line change
@@ -29,6 +29,9 @@ public function testShouldBeFinal()
$this->assertClassFinal(ChainExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExtensionsArray()
{
new ChainExtension([$this->createExtension(), $this->createExtension()]);
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@

class DelayRedeliveredMessageExtensionTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DelayRedeliveredMessageExtension($this->createDriverMock(), 12345);
Original file line number Diff line number Diff line change
@@ -34,6 +34,9 @@ public function testShouldBeFinal()
$this->assertClassFinal(ExclusiveCommandExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithDriverAsFirstArgument()
{
new ExclusiveCommandExtension($this->createDriverStub());
Original file line number Diff line number Diff line change
@@ -30,6 +30,9 @@ public function testShouldImplementEndExtensionInterface()
$this->assertClassImplements(EndExtensionInterface::class, FlushSpoolProducerExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithSpoolProducerAsFirstArgument()
{
new FlushSpoolProducerExtension($this->createSpoolProducerMock());
Original file line number Diff line number Diff line change
@@ -55,6 +55,9 @@ public function testShouldSubClassOfLogExtension()
$this->assertClassExtends(\Enqueue\Consumption\Extension\LogExtension::class, LogExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithoutAnyArguments()
{
new LogExtension();
Original file line number Diff line number Diff line change
@@ -27,6 +27,9 @@ public function testShouldImplementMessageReceivedExtensionInterface()
$this->assertClassImplements(MessageReceivedExtensionInterface::class, SetRouterPropertiesExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new SetRouterPropertiesExtension($this->createDriverMock());
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ public function testShouldImplementStartExtensionInterface()
$this->assertClassImplements(StartExtensionInterface::class, SetupBrokerExtension::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new SetupBrokerExtension($this->createDriverMock());
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/DelegateProcessorTest.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,9 @@

class DelegateProcessorTest extends TestCase
{
/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new DelegateProcessor($this->createProcessorRegistryMock());
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/DriverFactoryTest.php
Original file line number Diff line number Diff line change
@@ -61,6 +61,9 @@ public function testShouldBeFinal()
$this->assertTrue($rc->isFinal());
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithoutAnyArguments()
{
new DriverFactory();
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/DriverPreSendTest.php
Original file line number Diff line number Diff line change
@@ -19,6 +19,9 @@ public function testShouldBeFinal()
self::assertClassFinal(DriverPreSend::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExpectedArguments()
{
new DriverPreSend(
Original file line number Diff line number Diff line change
@@ -22,6 +22,9 @@ public function testShouldImplementExtensionInterface()
$this->assertTrue($rc->implementsInterface(PreSendCommandExtensionInterface::class));
}

/**
* @doesNotPerformAssertions
*/
public function testCouldConstructedWithoutAnyArguments()
{
new PrepareBodyExtension();
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/PostSendTest.php
Original file line number Diff line number Diff line change
@@ -21,6 +21,9 @@ public function testShouldBeFinal()
self::assertClassFinal(PostSend::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExpectedArguments()
{
new PostSend(
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/PreSendTest.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ public function testShouldBeFinal()
self::assertClassFinal(PreSend::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithExpectedArguments()
{
new PreSend(
6 changes: 6 additions & 0 deletions pkg/enqueue/Tests/Client/ProducerTest.php
Original file line number Diff line number Diff line change
@@ -24,11 +24,17 @@ public function testShouldBeFinal()
self::assertClassFinal(Producer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRequiredArguments()
{
new Producer($this->createDriverMock(), $this->createRpcFactoryMock());
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithOptionalArguments()
{
new Producer(
3 changes: 3 additions & 0 deletions pkg/enqueue/Tests/Client/SpoolProducerTest.php
Original file line number Diff line number Diff line change
@@ -18,6 +18,9 @@ public function testShouldImplementProducerInterface()
self::assertClassImplements(ProducerInterface::class, SpoolProducer::class);
}

/**
* @doesNotPerformAssertions
*/
public function testCouldBeConstructedWithRealProducer()
{
new SpoolProducer($this->createProducerMock());
Loading
Loading