prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Mi... | $message = new DummyMessage('Hello');
$envelope = new Envelope($message);
$stack = $this->getStackMock(false);
$middleware = $this->createMock(MiddlewareInterface::class);
$middleware->expects($this->once())->method('h | er\Tests\Fixtures\DummyMessage;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
class ActivationMiddlewareTest extends MiddlewareTestCase
{
public function testExecuteMiddlewareOnActivated()
{
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/ActivationMiddlewareTest.php",
"language": "php",
"file_size": 2460,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envel... | ameStampMiddleware('the_bus_name');
$envelope = new Envelope(new DummyMessage('the message'));
$finalEnvelope = $middleware->handle($envelope, $this->getStackMock());
/** @var BusNameStamp $busNameStamp */
$busNameStamp = $ | e;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
class AddBusNameStampMiddlewareTest extends MiddlewareTestCase
{
public function testItSendsTheMessageToAssignedSender()
{
$middleware = new AddBusN | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/AddBusNameStampMiddlewareTest.php",
"language": "php",
"file_size": 1396,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Lock\LockFactory;
use Symfony\Component\Lock\Store\FlockStore;
use Symfony\Component\Lock\Store\Semaphore... | public function testDeduplicateMiddlewareIgnoreIfMessageIsNotLockable()
{
$message = new DummyMessage('Hello');
$envelope = new Envelope($message);
$lockFactory = $this->createMock(LockFactory::class);
$lockFactory- | \Messenger\Stamp\ReceivedStamp;
use Symfony\Component\Messenger\Test\Middleware\MiddlewareTestCase;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
final class DeduplicateMiddlewareTest extends MiddlewareTestCase
{
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/DeduplicateMiddlewareTest.php",
"language": "php",
"file_size": 3782,
"cut_index": 614,
"middle_length": 229
} |
senger\Exception\HandlerFailedException;
use Symfony\Component\Messenger\Exception\LogicException;
use Symfony\Component\Messenger\Exception\NoHandlerForMessageException;
use Symfony\Component\Messenger\Handler\Acknowledger;
use Symfony\Component\Messenger\Handler\BatchHandlerInterface;
use Symfony\Component\Messenger\... | entsStamp;
use Symfony\Component\Messenger\Stamp\NoAutoAckStamp;
use Symfony\Component\Messenger\Test\Middleware\MiddlewareTestCase;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
class HandleMessageMiddlewareTest extends MiddlewareTestCase
| MessageMiddleware;
use Symfony\Component\Messenger\Middleware\StackMiddleware;
use Symfony\Component\Messenger\Stamp\AckStamp;
use Symfony\Component\Messenger\Stamp\HandledStamp;
use Symfony\Component\Messenger\Stamp\HandlerArgum | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/HandleMessageMiddlewareTest.php",
"language": "php",
"file_size": 13979,
"cut_index": 921,
"middle_length": 229
} |
\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Event\MessageSentToTransportsEvent;
use Symfony\Component\Messenger\Event\SendMessageToTransportsEvent;
use Symfony\Component\Messenger\Exception\NoSenderForMessageException;
use Symfony\Component\Messe... | ponent\Messenger\Transport\Sender\SenderInterface;
use Symfony\Component\Messenger\Transport\Sender\SendersLocator;
class SendMessageMiddlewareTest extends MiddlewareTestCase
{
public function testItSendsTheMessageToAssignedSender()
{
$mes | dlewareTestCase;
use Symfony\Component\Messenger\Tests\Fixtures\ChildDummyMessage;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessageInterface;
use Symfony\Com | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/SendMessageMiddlewareTest.php",
"language": "php",
"file_size": 10947,
"cut_index": 921,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use PHPUnit\Framework\TestCase;
use S... | ->method('handle')
->willReturnCallback(static function (Envelope $envelope, StackInterface $stack): Envelope {
$fork = clone $stack;
$stack->next()->handle($envelope, $stack);
$fork->next | kInterface;
class StackMiddlewareTest extends TestCase
{
public function testClone()
{
$middleware1 = $this->createMock(MiddlewareInterface::class);
$middleware1
->expects($this->once())
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/StackMiddlewareTest.php",
"language": "php",
"file_size": 1496,
"cut_index": 524,
"middle_length": 229
} |
e Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Messenger\Command\ConsumeMessagesCommand;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\EventListener\ResetServicesListener;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\MessageBusInterf... | r()
{
$command = new ConsumeMessagesCommand(new RoutableMessageBus(new Container()), new ServiceLocator([]), new EventDispatcher(), null, ['amqp']);
$inputArgument = $command->getDefinition()->getArgument('receivers');
$this->as | \Messenger\Tests\Fixtures\ResettableDummyReceiver;
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
class ConsumeMessagesCommandTest extends TestCase
{
public function testConfigurationWithDefaultReceive | {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/ConsumeMessagesCommandTest.php",
"language": "php",
"file_size": 25892,
"cut_index": 1331,
"middle_length": 229
} |
y\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface;
class FailedMessagesRemoveCommandTest extends TestCase
{
public function testRemoveSingleMessageWithServiceLocator()
{
$globalFailureReceiverName = 'failure_receiver';
... | ;
$tester->execute(['id' => 20, '--force' => true]);
$this->assertStringContainsString('Failed Message Details', $tester->getDisplay());
$this->assertStringContainsString('Message with id 20 removed.', $tester->getDisplay());
} | ommand = new FailedMessagesRemoveCommand(
$globalFailureReceiverName,
new ServiceLocator([$globalFailureReceiverName => static fn () => $receiver])
);
$tester = new CommandTester($command) | {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/FailedMessagesRemoveCommandTest.php",
"language": "php",
"file_size": 17602,
"cut_index": 1331,
"middle_length": 229
} |
ony\Component\Messenger\Stamp\SentToFailureTransportStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\Component\Messenger\Transport... | public function testBasicRunWithServiceLocator()
{
$sentToFailureStamp = new SentToFailureTransportStamp('async');
$redeliveryStamp = new RedeliveryStamp(0);
$errorStamp = ErrorDetailsStamp::create(new \Exception('Things are | $this->colSize = getenv('COLUMNS');
putenv('COLUMNS='.(119 + \strlen(\PHP_EOL)));
}
protected function tearDown(): void
{
putenv($this->colSize ? 'COLUMNS='.$this->colSize : 'COLUMNS');
}
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/FailedMessagesShowCommandTest.php",
"language": "php",
"file_size": 21260,
"cut_index": 1331,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Command;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Tester\CommandComplet... |
{
public function testReceiverNames()
{
$command = new SetupTransportsCommand(new ServiceLocator([
'amqp' => fn () => $this->createStub(SetupableTransportInterface::class),
'other_transport' => fn () => $this->creat | ent\Messenger\Command\SetupTransportsCommand;
use Symfony\Component\Messenger\Transport\SetupableTransportInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
class SetupTransportsCommandTest extends TestCase | {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/SetupTransportsCommandTest.php",
"language": "php",
"file_size": 3701,
"cut_index": 614,
"middle_length": 229
} |
nger\Exception\InvalidMessageSignatureException;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Tests\Fixtures\ChildDummyMessage;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessageInterface;
... | er\Transport\Serialization\SigningSerializer;
class SigningSerializerTest extends TestCase
{
public function testEncodeAddsSignatureHeadersWhenTypeIsSigned()
{
$serializer = $this->createSerializer([DummyMessage::class]);
$envelope | onent\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messeng | {
"filepath": "src/Symfony/Component/Messenger/Tests/Transport/Serialization/SigningSerializerTest.php",
"language": "php",
"file_size": 13058,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Transport\InMemory;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\DelayStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Te... | {
$this->transport = new InMemoryTransport();
}
public function testSend()
{
$envelope = new Envelope(new \stdClass());
$this->transport->send($envelope);
$this->assertEquals([$envelope->with(new TransportMes | \Transport\Serialization\SerializerInterface;
/**
* @author Gary PEGEOT <garypegeot@gmail.com>
*/
class InMemoryTransportTest extends TestCase
{
private InMemoryTransport $transport;
protected function setUp(): void
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Transport/InMemory/InMemoryTransportTest.php",
"language": "php",
"file_size": 8160,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Stamp;
use PHPUnit\Framework\TestCase;
use Symfon... | $this->assertSame(1800000, $stamp->getDelay());
$stamp = DelayStamp::delayFor(\DateInterval::createFromDateString('30 hours'));
$this->assertSame(108000000, $stamp->getDelay());
$stamp = DelayStamp::delayFor(\DateInterval:: | $stamp = DelayStamp::delayFor(\DateInterval::createFromDateString('30 seconds'));
$this->assertSame(30000, $stamp->getDelay());
$stamp = DelayStamp::delayFor(\DateInterval::createFromDateString('30 minutes'));
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Stamp/DelayStampTest.php",
"language": "php",
"file_size": 1426,
"cut_index": 524,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envelope;
use Symf... | DefaultStampsProviderDummyMessage('');
$envelope = new Envelope($message);
$decorator = new AddDefaultStampsMiddleware();
$envelope = $decorator->handle($envelope, $this->getStackMock(true));
$delayStamp = $envelope->last | \Component\Messenger\Tests\Fixtures\DefaultStampsProviderDummyMessage;
final class AddDefaultStampsMiddlewareTest extends MiddlewareTestCase
{
public function testSelfStampableStampsMiddleware()
{
$message = new | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/AddDefaultStampsMiddlewareTest.php",
"language": "php",
"file_size": 1650,
"cut_index": 537,
"middle_length": 229
} |
ase;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\DelayedMessageHandlingException;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Middleware\DispatchAfterCurrentBusMiddleware;
use Symfony\Component\M... | $firstEvent = new DummyEvent('First event');
$secondEvent = new DummyEvent('Second event');
$thirdEvent = new DummyEvent('Third event');
$middleware = new DispatchAfterCurrentBusMiddleware();
$handlingMiddleware = $ | ssenger\Tests\Fixtures\DummyMessage;
class DispatchAfterCurrentBusMiddlewareTest extends TestCase
{
public function testEventsInNewTransactionAreHandledAfterMainMessage()
{
$message = new DummyMessage('Hello');
| {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/DispatchAfterCurrentBusMiddlewareTest.php",
"language": "php",
"file_size": 12448,
"cut_index": 921,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;
use Symfony\Component\Messenger\Middleware\StackMiddleware;
use ... | eableMiddlewareTest extends MiddlewareTestCase
{
public function testHandle()
{
$busId = 'command_bus';
$envelope = new Envelope(new DummyMessage('Hello'));
$middleware = new class implements MiddlewareInterface {
| ymfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Stopwatch\Stopwatch;
use Symfony\Component\Stopwatch\StopwatchEvent;
/**
* @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
*/
class Trac | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/TraceableMiddlewareTest.php",
"language": "php",
"file_size": 8621,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Ex... | mponent\Validator\Validator\ValidatorInterface;
class ValidationMiddlewareTest extends MiddlewareTestCase
{
public function testValidateAndNextMiddleware()
{
$message = new DummyMessage('Hey');
$envelope = new Envelope($message);
| Middleware\MiddlewareTestCase;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Validator\ConstraintViolationList;
use Symfony\Component\Validator\ConstraintViolationListInterface;
use Symfony\Co | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/ValidationMiddlewareTest.php",
"language": "php",
"file_size": 2878,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Transport\Serialization;
use Symfony\Component\Messenger\Envel... | serializer = $this->createPhpSerializer();
$envelope = $serializer->decode([
'body' => 'O:13:"ReceivedSt0mp":0:{}',
]);
$this->assertInstanceOf(MessageDecodingFailedException::class, $envelope->getMessage());
}
| DummyMessage;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
class PhpSerializerWithClassNotFoundSupportTest extends PhpSerializerTest
{
public function testDecodingFailsWithBadClass()
{
$ | {
"filepath": "src/Symfony/Component/Messenger/Tests/Transport/Serialization/PhpSerializerWithClassNotFoundSupportTest.php",
"language": "php",
"file_size": 1817,
"cut_index": 537,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Transport\Serialization\Normalizer;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\ErrorHandler\Exception\FlattenException;
use Symfony\Component\Messenger\Transport\Serialization\Normali... | ion()
{
$this->assertTrue($this->normalizer->supportsNormalization(new FlattenException(), null, $this->getMessengerContext()));
$this->assertFalse($this->normalizer->supportsNormalization(new FlattenException()));
$this->assert | st extends TestCase
{
private FlattenExceptionNormalizer $normalizer;
protected function setUp(): void
{
$this->normalizer = new FlattenExceptionNormalizer();
}
public function testSupportsNormalizat | {
"filepath": "src/Symfony/Component/Messenger/Tests/Transport/Serialization/Normalizer/FlattenExceptionNormalizerTest.php",
"language": "php",
"file_size": 7556,
"cut_index": 716,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Stamp;
use PHPUnit\Framework\TestCase;
use ... | eTimeImmutable::createFromFormat(\DateTimeInterface::ISO8601, '2005-08-15T15:52:01+0000'));
$this->assertSame('2005-08-15T15:52:01+0000', $stamp->getRedeliveredAt()->format(\DateTimeInterface::ISO8601));
}
public function testRedeliveryAt( | ->assertSame(10, $stamp->getRetryCount());
$this->assertInstanceOf(\DateTimeInterface::class, $stamp->getRedeliveredAt());
}
public function testSerialization()
{
$stamp = new RedeliveryStamp(10, \Dat | {
"filepath": "src/Symfony/Component/Messenger/Tests/Stamp/RedeliveryStampTest.php",
"language": "php",
"file_size": 1210,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerInterface;
use Psr\Container\NotFoundExceptionInterface;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedExceptio... | Stamp;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
class DecodeFailedMessageMiddlewareTest extends TestCase
{
public function testItDecodesSerializedEnvelope | erface;
use Symfony\Component\Messenger\Middleware\StackMiddleware;
use Symfony\Component\Messenger\Stamp\AckStamp;
use Symfony\Component\Messenger\Stamp\ReceivedStamp;
use Symfony\Component\Messenger\Stamp\SentToFailureTransport | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/DecodeFailedMessageMiddlewareTest.php",
"language": "php",
"file_size": 6075,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Command;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Console\Application;
use Symfony\Component\Console\Exception\RuntimeException;
use Symfony\Component\Console\Tester\CommandCompleti... | nent\Messenger\Tests\Fixtures\DummyQuery;
use Symfony\Component\Messenger\Tests\Fixtures\DummyQueryHandler;
use Symfony\Component\Messenger\Tests\Fixtures\MultipleBusesMessage;
use Symfony\Component\Messenger\Tests\Fixtures\MultipleBusesMessageHandler;
/* | ponent\Messenger\Tests\Fixtures\DummyCommandHandler;
use Symfony\Component\Messenger\Tests\Fixtures\DummyCommandWithDescription;
use Symfony\Component\Messenger\Tests\Fixtures\DummyCommandWithDescriptionHandler;
use Symfony\Compo | {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/DebugCommandTest.php",
"language": "php",
"file_size": 8117,
"cut_index": 716,
"middle_length": 229
} |
it\Framework\TestCase;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Stamp\DeduplicateStamp;
use Symfony\Component\Messenger\Stamp\NonSendableStampInterface;
use Symfony\Component\Messenger\Stamp\SerializedMessageStamp... | se Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
use Symfony\Component\Serializer\SerializerInterface as SerializerComponentInterface;
class SerializerTest extends TestCase
{
public function testEncodedIsDecodable()
{
$serializ | nt\Messenger\Tests\Fixtures\DummyMessageWithInterfaceWithSerializedTypeName;
use Symfony\Component\Messenger\Tests\Fixtures\DummyMessageWithSerializedTypeName;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
u | {
"filepath": "src/Symfony/Component/Messenger/Tests/Transport/Serialization/SerializerTest.php",
"language": "php",
"file_size": 14450,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Middleware;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Mi... | nent\Routing\RequestContext;
use Symfony\Component\Routing\RequestContextAwareInterface;
class RouterContextMiddlewareTest extends MiddlewareTestCase
{
public function testMiddlewareStoreContext()
{
$context = new RequestContext('/', 'GET' | dleware\StackMiddleware;
use Symfony\Component\Messenger\Stamp\ConsumedByWorkerStamp;
use Symfony\Component\Messenger\Stamp\RouterContextStamp;
use Symfony\Component\Messenger\Test\Middleware\MiddlewareTestCase;
use Symfony\Compo | {
"filepath": "src/Symfony/Component/Messenger/Tests/Middleware/RouterContextMiddlewareTest.php",
"language": "php",
"file_size": 2741,
"cut_index": 563,
"middle_length": 229
} |
onsole\Tester\CommandTester;
use Symfony\Component\DependencyInjection\ServiceLocator;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\Messenger\Command\FailedMessagesRetryCommand;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\MessageBus;
use Symfony\Component\Me... | or()
{
$series = [
[[10], new Envelope(new \stdClass())],
[[12], new Envelope(new \stdClass())],
];
$receiver = $this->createMock(ListableReceiverInterface::class);
$receiver->expects($this->exac | ransport\Receiver\ListableReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
class FailedMessagesRetryCommandTest extends TestCase
{
public function testBasicRunWithServiceLocat | {
"filepath": "src/Symfony/Component/Messenger/Tests/Command/FailedMessagesRetryCommandTest.php",
"language": "php",
"file_size": 12473,
"cut_index": 921,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Tests\Stamp;
use PHPUnit\Framework\TestCase;
use ... | ionStamp($groups = new GroupSequence(['Default', 'Then']));
$this->assertSame($groups, $stamp->getGroups());
}
public function testSerializable()
{
$this->assertEquals($stamp = new ValidationStamp(['Default', 'Extra']), unseria | dationStampTest extends TestCase
{
public function testStamp()
{
$stamp = new ValidationStamp($groups = ['Default', 'Extra']);
$this->assertSame($groups, $stamp->getGroups());
$stamp = new Validat | {
"filepath": "src/Symfony/Component/Messenger/Tests/Stamp/ValidationStampTest.php",
"language": "php",
"file_size": 1168,
"cut_index": 518,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Middleware;
use Symfony\Component\Messenger\Bridge\AmazonSqs\MessageDeduplicationAwareInterface;
use Symfony\Component\Mes... | Only()
{
$middleware = new AddFifoStampMiddleware();
$envelope = new Envelope(new WithMessageGroupIdMessage('groupId'));
$finalEnvelope = $middleware->handle($envelope, $this->getStackMock());
$stamp = $finalEnvelope->la | rt\AmazonSqsFifoStamp;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Test\Middleware\MiddlewareTestCase;
class AddFifoStampTest extends MiddlewareTestCase
{
public function testAddStampWithGroupId | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Middleware/AddFifoStampTest.php",
"language": "php",
"file_size": 3934,
"cut_index": 614,
"middle_length": 229
} |
Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineReceivedStamp;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineReceiv... | erializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNorma | y\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Serializer as S | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineReceiverTest.php",
"language": "php",
"file_size": 15354,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messeng... | e;
class DoctrineSenderTest extends TestCase
{
public function testSend()
{
$envelope = new Envelope(new DummyMessage('Oy'));
$encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]];
$connection = $this- | use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\DelayStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterfac | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineSenderTest.php",
"language": "php",
"file_size": 2452,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\Persistence\ConnectionRegistry;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doct... | n;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
class DoctrineTransportFactoryTest extends TestCase
{
public function testSupports()
{
$factory = new DoctrineTransportFactory(
$this->createStub(C | port;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransportFactory;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection;
use Symfony\Component\Messenger\Exception\TransportExceptio | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineTransportFactoryTest.php",
"language": "php",
"file_size": 6681,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Connection as DbalConnection;
use Doctrine\DBAL\Schema\Schema;
use PHPUnit\Framework\TestCase;... | ce;
use Symfony\Component\Messenger\Transport\TransportInterface;
class DoctrineTransportTest extends TestCase
{
public function testItIsATransport()
{
$transport = $this->getTransport();
$this->assertInstanceOf(TransportInterface | ine\Transport\DoctrineReceivedStamp;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\DoctrineTransport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterfa | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineTransportTest.php",
"language": "php",
"file_size": 3263,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Result as DriverResult;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Result;
use PHPUnit\Framework\T... | ->createStub(Connection::class);
$driverConnection->method('executeStatement')->willReturn(1);
$connection = new PostgreSqlConnection([], $driverConnection);
serialize($connection);
}
public function testUnserialize()
|
public function testSerialize()
{
$this->expectException(\BadMethodCallException::class);
$this->expectExceptionMessage('Cannot serialize '.PostgreSqlConnection::class);
$driverConnection = $this | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/PostgreSqlConnectionTest.php",
"language": "php",
"file_size": 8780,
"cut_index": 716,
"middle_length": 229
} |
L\Platforms\PostgreSQLPlatform;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Result;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\EventListener\PostgreSqlNotifyOnIdleListener;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection;
use Symfony\Compon... | $driverConnection->method('executeStatement')->willReturn(1);
return new PostgreSqlConnection($additionalConfig + ['table_name' => 'queue_table'], $driverConnection);
}
private function createWorkerWithTransports(array $transportNam | PostgreSqlNotifyOnIdleListenerTest extends TestCase
{
private function createPostgreSqlConnection(array $additionalConfig = []): PostgreSqlConnection
{
$driverConnection = $this->createStub(Connection::class);
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/EventListener/PostgreSqlNotifyOnIdleListenerTest.php",
"language": "php",
"file_size": 15364,
"cut_index": 921,
"middle_length": 229
} |
is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
class AmqpFactory
{
public function cre... | }
public function createQueue(\AMQPChannel $channel): \AMQPQueue
{
return new \AMQPQueue($channel);
}
public function createExchange(\AMQPChannel $channel): \AMQPExchange
{
return new \AMQPExchange($channel);
}
| {
return new \AMQPChannel($connection);
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpFactory.php",
"language": "php",
"file_size": 845,
"cut_index": 535,
"middle_length": 52
} |
s part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Messenger\Stamp\NonSen... | lope $amqpEnvelope,
private string $queueName,
) {
}
public function getAmqpEnvelope(): \AMQPEnvelope
{
return $this->amqpEnvelope;
}
public function getQueueName(): string
{
return $this->queueName;
| vate \AMQPEnve | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpReceivedStamp.php",
"language": "php",
"file_size": 812,
"cut_index": 536,
"middle_length": 14
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\LogicException;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Exception\Transpor... | ssages from AMQP brokers using PHP's AMQP extension.
*
* @author Samuel Roze <samuel.roze@gmail.com>
*/
class AmqpReceiver implements QueueReceiverInterface, MessageCountAwareInterface
{
private SerializerInterface $serializer;
public function | ort\Receiver\QueueReceiverInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
/**
* Symfony Messenger receiver to get me | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpReceiver.php",
"language": "php",
"file_size": 6503,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\TransportException;
use Symfony\Compon... | nterface;
/**
* Symfony Messenger sender to send messages to AMQP brokers using PHP's AMQP extension.
*
* @author Samuel Roze <samuel.roze@gmail.com>
*/
class AmqpSender implements SenderInterface
{
private SerializerInterface $serializer;
pu | TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerI | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpSender.php",
"language": "php",
"file_size": 3099,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Messenger\Stamp\NonSendableStampInterface;
/**
... | tring
{
return $this->routingKey;
}
public function getFlags(): int
{
return $this->flags;
}
public function getAttributes(): array
{
return $this->attributes;
}
public static function createFr | mpt = false;
public function __construct(
private ?string $routingKey = null,
private int $flags = \AMQP_NOPARAM,
private array $attributes = [],
) {
}
public function getRoutingKey(): ?s | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpStamp.php",
"language": "php",
"file_size": 2825,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messeng... | mfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Nicolas Grekas <p@tchwork.com>
*/
class AmqpTransport implements QueueReceiverInterface, TransportInterface, SetupableTransportInterface, CloseableTransportInterface, MessageCountAwar | ce;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\SetupableTransportInterface;
use Sy | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpTransport.php",
"language": "php",
"file_size": 2825,
"cut_index": 563,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Transport;
use Symfony\Component\Mess... | string $dsn, array $options, SerializerInterface $serializer): TransportInterface
{
unset($options['transport_name']);
return new AmqpTransport(Connection::fromDsn($dsn, $options), $serializer);
}
public function supports(#[\ | uthor Samuel Roze <samuel.roze@gmail.com>
*
* @implements TransportFactoryInterface<AmqpTransport>
*/
class AmqpTransportFactory implements TransportFactoryInterface
{
public function createTransport(#[\SensitiveParameter] | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/AmqpTransportFactory.php",
"language": "php",
"file_size": 1158,
"cut_index": 518,
"middle_length": 229
} |
];
/**
* @see https://github.com/php-amqp/php-amqp/blob/master/amqp_connection_resource.h
*/
private const AVAILABLE_OPTIONS = [
'host',
'port',
'vhost',
'user',
'login',
'password',
'queues',
'exchange',
'delay',
'aut... | inding_keys',
'binding_arguments',
'flags',
'arguments',
];
private const AVAILABLE_EXCHANGE_OPTIONS = [
'name',
'type',
'default_publish_routing_key',
'flags',
'arguments',
' | 'connect_timeout',
'rpc_timeout',
'cacert',
'cert',
'key',
'verify',
'sasl_method',
'connection_name',
];
private const AVAILABLE_QUEUE_OPTIONS = [
'b | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Transport/Connection.php",
"language": "php",
"file_size": 26222,
"cut_index": 1331,
"middle_length": 229
} |
_SERVER['COMPONENT_ROOT'];
if (!is_file($autoload = $componentRoot.'/vendor/autoload.php')) {
$autoload = $componentRoot.'/../../../../../../vendor/autoload.php';
}
if (!file_exists($autoload)) {
exit('You should run "composer install --dev" in the component before running this script.');
}
require_once $aut... | n\Serializer;
use Symfony\Component\Messenger\Worker;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serial | ion;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\EventListener\DispatchPcntlSignalListener;
use Symfony\Component\Messenger\MessageBusInterface;
use Symfony\Component\Messenger\Transport\Serializatio | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Fixtures/long_receiver.php",
"language": "php",
"file_size": 1987,
"cut_index": 537,
"middle_length": 229
} |
nit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Amqp\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpReceivedStamp;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpReceiver;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender;
use Symfony\Comp... | \Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Process\PhpProcess;
use Symfony\Component\Process\Process;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symf | mp\DelayStamp;
use Symfony\Component\Messenger\Stamp\RedeliveryStamp;
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpExtIntegrationTest.php",
"language": "php",
"file_size": 12838,
"cut_index": 921,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
use PHPUnit\Framework\Attribute... | {
$amqpEnvelope = $this->createStub(\AMQPEnvelope::class);
$stamp = new AmqpReceivedStamp($amqpEnvelope, 'queueName');
$this->assertSame($amqpEnvelope, $stamp->getAmqpEnvelope());
$this->assertSame('queueName', $stamp->ge | tends TestCase
{
public function testStamp()
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpReceivedStampTest.php",
"language": "php",
"file_size": 860,
"cut_index": 529,
"middle_length": 52
} |
onent\Messenger\Bridge\Amqp\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpReceivedStamp;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpReceiver;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Co... | ncoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ArrayDenormalizer;
use Symfony\Component\Serializer\Normalizer\DateTimeNormalizer;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
#[RequiresPhpExtension('amqp')]
class AmqpRece | fony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\E | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpReceiverTest.php",
"language": "php",
"file_size": 9750,
"cut_index": 921,
"middle_length": 229
} |
onent\Messenger\Bridge\Amqp\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpPriorityStamp;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpReceivedStamp;
use Symfony\Component\Messenger\Bridge\Amqp\Transport\AmqpSender;
use Symfony\Component\Messenger\Bridge\Amqp\Transpo... | e Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
#[RequiresPhpExtension('amqp')]
class AmqpSenderTest extends TestCase
{
public function testItSendsTheEncodedMessage()
{
$envelope = new Envelope(new DummyMessage(' | ony\Component\Messenger\Stamp\DelayStamp;
use Symfony\Component\Messenger\Stamp\RedeliveryStamp;
use Symfony\Component\Messenger\Stamp\SentToFailureTransportStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
us | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpSenderTest.php",
"language": "php",
"file_size": 10342,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messeng... | gsAndAttributes()
{
$stamp = new AmqpStamp(null, \AMQP_DURABLE, ['delivery_mode' => 'unknown']);
$this->assertNull($stamp->getRoutingKey());
$this->assertSame(\AMQP_DURABLE, $stamp->getFlags());
$this->assertSame(['deliv | ng_key');
$this->assertSame('routing_key', $stamp->getRoutingKey());
$this->assertSame(\AMQP_NOPARAM, $stamp->getFlags());
$this->assertSame([], $stamp->getAttributes());
}
public function testFla | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpStampTest.php",
"language": "php",
"file_size": 3417,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
use PHPUnit\Framework\Attributes\Requir... | lyAmqpTransports()
{
$factory = new AmqpTransportFactory();
$this->assertTrue($factory->supports('amqp://localhost', []));
$this->assertFalse($factory->supports('sqs://localhost', []));
$this->assertFalse($factory->supp |
use Symfony\Component\Messenger\Bridge\Amqp\Transport\Connection;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
class AmqpTransportFactoryTest extends TestCase
{
public function testSupportsOn | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpTransportFactoryTest.php",
"language": "php",
"file_size": 1532,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Amqp\Tests\Transport;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUni... | sPhpExtension('amqp')]
class AmqpTransportTest extends TestCase
{
public function testItIsATransport()
{
$transport = $this->getTransport();
$this->assertInstanceOf(TransportInterface::class, $transport);
}
public function | ger\Bridge\Amqp\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
#[Require | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/AmqpTransportTest.php",
"language": "php",
"file_size": 2344,
"cut_index": 563,
"middle_length": 229
} |
s->assertArrayNotHasKey('user', $options);
$connection = new Connection(['host' => 'localhost', 'user' => 'alice', 'login' => 'bob'], ['name' => self::DEFAULT_EXCHANGE_NAME], [self::DEFAULT_EXCHANGE_NAME => []]);
$options = $r->getValue($connection);
$this->assertSame('bob', $options['login']);... | > [],
]),
Connection::fromDsn('amqp://')
);
}
public function testItCanBeConstructedWithAnAmqpsDsn()
{
$this->assertEquals(
new Connection([
'host' => 'localhost',
| 'host' => 'localhost',
'port' => 5672,
'vhost' => '/',
], [
'name' => self::DEFAULT_EXCHANGE_NAME,
], [
self::DEFAULT_EXCHANGE_NAME = | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Amqp/Tests/Transport/ConnectionTest.php",
"language": "php",
"file_size": 50603,
"cut_index": 2151,
"middle_length": 229
} |
eout' => 0.0, // Float, value in seconds (optional, default is 0 meaning unlimited)
'read_timeout' => 0.0, // Float, value in seconds (optional, default is 0 meaning unlimited)
'retry_interval' => 0, // Int, value in milliseconds (optional, default is 0)
'persistent_id' => null, // String, per... | utoSetup;
private int $maxEntries;
private int $redeliverTimeout;
private float $nextClaim = 0.0;
private float $claimInterval;
private bool $deleteAfterAck;
private bool $deleteAfterReject;
private ?string $lastPendingMessageId | private \Redis|Relay|\RedisCluster|null $redis = null;
private \Closure $redisInitializer;
private string $stream;
private string $queue;
private string $group;
private string $consumer;
private bool $a | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Transport/Connection.php",
"language": "php",
"file_size": 33977,
"cut_index": 2151,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\LogicException;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Exception\Transpo... | ort\Serialization\SerializerInterface;
/**
* @author Alexander Schranz <alexander@sulu.io>
* @author Antoine Bluchet <soyuka@gmail.com>
*/
class RedisReceiver implements KeepaliveReceiverInterface, MessageCountAwareInterface, ListableReceiverInterface
| port\Receiver\ListableReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transp | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisReceiver.php",
"language": "php",
"file_size": 5857,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Transport;
use Symfony\Component\Messenger... | public function __construct(
private Connection $connection,
private SerializerInterface $serializer,
) {
}
public function send(Envelope $envelope): Envelope
{
$encodedMessage = $this->serializer->encode($envelope | e Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
/**
* @author Alexander Schranz <alexander@sulu.io>
* @author Antoine Bluchet <soyuka@gmail.com>
*/
class RedisSender implements SenderInterface
{
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisSender.php",
"language": "php",
"file_size": 1377,
"cut_index": 524,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messen... | se Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Alexander Schranz <alexander@sulu.io>
* @author Antoine Bluchet <soyuka@gmail.com>
*/
class RedisTransport implements TransportInterface, KeepaliveReceiverInterface, SetupableTr | terface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\SetupableTransportInterface;
u | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransport.php",
"language": "php",
"file_size": 2757,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Transport;
use Symfony\Component\Messenger... | ction createTransport(#[\SensitiveParameter] string $dsn, array $options, SerializerInterface $serializer): TransportInterface
{
unset($options['transport_name']);
return new RedisTransport(Connection::fromDsn($dsn, $options), $seriali | Alexander Schranz <alexander@suluio>
* @author Antoine Bluchet <soyuka@gmail.com>
*
* @implements TransportFactoryInterface<RedisTransport>
*/
class RedisTransportFactory implements TransportFactoryInterface
{
public fun | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Transport/RedisTransportFactory.php",
"language": "php",
"file_size": 1280,
"cut_index": 524,
"middle_length": 229
} |
Connection::fromDsn('redis:///var/run/redis/redis.sock', ['stream' => 'queue'], $this->createRedisMock())
);
}
public function testFromDsnWithOptions()
{
$this->assertEqualsConnection(
Connection::fromDsn('redis://localhost', ['stream' => 'queue', 'group' => 'group1', 'cons... | ', 'group' => 'group1', 'consumer' => 'consumer1', 'auto_setup' => false, 'serializer' => 2], $this->createRedisMock()),
Connection::fromDsn('redis://localhost/queue/group1/consumer1?serializer=2&auto_setup=0', [], $this->createRedisMock())
| , [], $this->createRedisMock())
);
}
public function testFromDsnWithOptionsAndTrailingSlash()
{
$this->assertEqualsConnection(
Connection::fromDsn('redis://localhost/', ['stream' => 'queue | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/ConnectionTest.php",
"language": "php",
"file_size": 39598,
"cut_index": 2151,
"middle_length": 229
} |
mework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Relay\Relay;
use Symfony\Component\Messenger\Bridge\Redis\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Redis\Transport\Connection;
use Symfony\Component\Messenger\Bridge\Redis\Transport\RedisReceiver;
use Symfony\Componen... | if (!getenv('MESSENGER_REDIS_DSN')) {
$this->markTestSkipped('The "MESSENGER_REDIS_DSN" environment variable is required.');
}
try {
$this->redis = $this->createRedisClient();
$this->connection = C | p('time-sensitive')]
#[Group('integration')]
class RedisExtIntegrationTest extends TestCase
{
private \Redis|Relay|null $redis = null;
private ?Connection $connection = null;
protected function setUp(): void
{
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisExtIntegrationTest.php",
"language": "php",
"file_size": 17163,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framewor... | ent\Messenger\Transport\Receiver\ListableReceiverInterface;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Compo | Redis\Transport\RedisReceivedStamp;
use Symfony\Component\Messenger\Bridge\Redis\Transport\RedisReceiver;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Compon | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisListableIntegrationTest.php",
"language": "php",
"file_size": 4359,
"cut_index": 614,
"middle_length": 229
} |
essenger\Bridge\Redis\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Redis\Tests\Fixtures\ExternalMessage;
use Symfony\Component\Messenger\Bridge\Redis\Tests\Fixtures\ExternalMessageSerializer;
use Symfony\Component\Messenger\Bridge\Redis\Transport\Connection;
use Symfony\Component\Messenger\Bridge... | er;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
c | essageDecodingFailedException;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\Serializ | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisReceiverTest.php",
"language": "php",
"file_size": 14372,
"cut_index": 921,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Transport;
use Symfony\Component\Messenger\Envelop... | r implements SenderInterface
{
private SerializerInterface $serializer;
public function __construct(
private Connection $connection,
?SerializerInterface $serializer = null,
) {
$this->serializer = $serializer ?? new Ph | y\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
/**
* @author Antonio Pauletich <antonio.pauletich95@gmail.com>
*/
class BeanstalkdSende | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/BeanstalkdSender.php",
"language": "php",
"file_size": 1516,
"cut_index": 537,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Transport;
use Symfony\Componen... | Transport(#[\SensitiveParameter] string $dsn, array $options, SerializerInterface $serializer): TransportInterface
{
unset($options['transport_name']);
return new BeanstalkdTransport(Connection::fromDsn($dsn, $options), $serializer);
|
* @author Antonio Pauletich <antonio.pauletich95@gmail.com>
*
* @implements TransportFactoryInterface<BeanstalkdTransport>
*/
class BeanstalkdTransportFactory implements TransportFactoryInterface
{
public function create | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/BeanstalkdTransportFactory.php",
"language": "php",
"file_size": 1165,
"cut_index": 518,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Transport;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Tran... | \SentForRetryStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Serializer a | er;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Stamp | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/BeanstalkdReceiverTest.php",
"language": "php",
"file_size": 6253,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Transport;
use PHPUnit\Framewor... | orts()
{
$factory = new BeanstalkdTransportFactory();
$this->assertTrue($factory->supports('beanstalkd://127.0.0.1', []));
$this->assertFalse($factory->supports('doctrine://127.0.0.1', []));
}
public function testCreat | \Component\Messenger\Bridge\Beanstalkd\Transport\Connection;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
final class BeanstalkdTransportFactoryTest extends TestCase
{
public function testSupp | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/BeanstalkdTransportFactoryTest.php",
"language": "php",
"file_size": 1377,
"cut_index": 524,
"middle_length": 229
} |
ats;
use Pheanstalk\Values\TubeList;
use Pheanstalk\Values\TubeName;
use Pheanstalk\Values\TubeStats;
use PHPUnit\Framework\Attributes\TestWith;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\Connection;
use Symfony\Component\Messenger\Exception\InvalidArgumentException as M... | )
{
$this->assertEquals(
$connection = new Connection([], Pheanstalk::create('127.0.0.1', 11300)),
Connection::fromDsn('beanstalkd://127.0.0.1')
);
$configuration = $connection->getConfiguration();
| $this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('The given Beanstalkd DSN is invalid.');
Connection::fromDsn('beanstalkd://');
}
public function testFromDsn( | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/ConnectionTest.php",
"language": "php",
"file_size": 22434,
"cut_index": 1331,
"middle_length": 229
} |
tifier;
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
use Doctrine\DBAL\Schema\NamedObject;
use Doctrine\DBAL\Schema\PrimaryKeyConstraint;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Sequence;
use Doctrine\DBAL\Schema\Table;
use Doctrine\DBAL\Types\Types;
use Satag\DoctrineFirebirdDriver\Platforms\Firebi... | s Connection implements ResetInterface
{
private const ORACLE_SEQUENCES_SUFFIX = '_seq';
protected const TABLE_OPTION_NAME = '_symfony_messenger_table_name';
protected const DEFAULT_OPTIONS = [
'table_name' => 'messenger_messages',
|
* @internal
*
* @author Vincent Touzet <vincent.touzet@gmail.com>
* @author Kévin Dunglas <dunglas@gmail.com>
* @author Herberto Graca <herberto.graca@gmail.com>
* @author Alexander Malyk <shu.rick.ifmo@gmail.com>
*/
clas | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/Connection.php",
"language": "php",
"file_size": 24062,
"cut_index": 1331,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
use Doctrine\DBAL\Connection as DbalConnection;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\Table;
use S... | use Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Vincent Touzet <vincent.touzet@gmail.com>
*/
class DoctrineTransport implements TransportInterface, SetupableTransportInterface, MessageCountAwareInterface, ListableReceiverInte | ;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\SetupableTransportInterface;
| {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransport.php",
"language": "php",
"file_size": 3557,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
use Doctrine\DBAL\Connection as DBALConnection;
/**
* Uses PostgreSQL LISTEN/NOTIFY to push messages to workers.
*
* If you do not want to use the LISTEN mechanism, set the `use_notify` option to `false` when calling... | et_notify_timeout: The maximum time to wait for a NOTIFY, in milliseconds. Default: 60000 (1 minute).
*/
protected const DEFAULT_OPTIONS = parent::DEFAULT_OPTIONS + [
'check_delayed_interval' => 60000,
'get_notify_timeout' => 60000 | g = false;
private bool $notifyHandledExternally = false;
/**
* * check_delayed_interval: The interval to check for delayed messages, in milliseconds. Set to 0 to disable checks. Default: 60000 (1 minute)
* * g | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/PostgreSqlConnection.php",
"language": "php",
"file_size": 5579,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\EventListener;
use Doctrine\DBAL\ArrayParameterType;
use Doctrine\DBAL\Types\Types;
use Psr\Clock\ClockInterface;
use Psr\Log\LoggerInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\Me... | ail.com>
*/
class PostgreSqlNotifyOnIdleListener implements EventSubscriberInterface
{
/** @var array<string, PostgreSqlConnection> */
private array $connections = [];
private ?PostgreSqlConnection $activeConnection = null;
private ?float | ker is idle, blocks on PostgreSQL LISTEN/NOTIFY instead of
* polling. This allows instant wake-up when a new message arrives while
* properly supporting workers that consume from multiple queues.
*
* @author d-ph <dph03292@gm | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/EventListener/PostgreSqlNotifyOnIdleListener.php",
"language": "php",
"file_size": 7367,
"cut_index": 716,
"middle_length": 229
} |
chemaManagerFactory;
use Doctrine\DBAL\Tools\DsnParser;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection;
#[RequiresPhpExtension('pdo_s... | agerFactory());
$this->driverConnection = DriverManager::getConnection($params, $config);
$this->connection = new Connection([], $this->driverConnection);
}
protected function tearDown(): void
{
$this->driverConnection | {
$dsn = getenv('MESSENGER_DOCTRINE_DSN') ?: 'pdo-sqlite://:memory:';
$params = (new DsnParser())->parse($dsn);
$config = new Configuration();
$config->setSchemaManagerFactory(new DefaultSchemaMan | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrineIntegrationTest.php",
"language": "php",
"file_size": 9602,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection... | pExtension('pdo_pgsql')]
#[Group('integration')]
class DoctrinePostgreSqlIntegrationTest extends TestCase
{
private Connection $driverConnection;
private PostgreSqlConnection $connection;
protected function setUp(): void
{
if (!$ho | utes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection;
#[RequiresPh | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlIntegrationTest.php",
"language": "php",
"file_size": 2798,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\Schema\DefaultSchemaManagerF... | s used when use_notify is enabled.
*/
#[RequiresPhpExtension('pdo_pgsql')]
#[Group('integration')]
class DoctrinePostgreSqlRegularIntegrationTest extends TestCase
{
private \Doctrine\DBAL\Connection $driverConnection;
private Connection $connectio | Messenger\Bridge\Doctrine\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\Connection;
/**
* This tests a using Doctrine PostgreSql connection without using PostgreSqlConnection
* that get | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlRegularIntegrationTest.php",
"language": "php",
"file_size": 3385,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Transport;
use AsyncAws\Sqs\SqsClient;
use PHPUnit\Framework\Attributes... | e "MESSENGER_SQS_FIFO_QUEUE_DSN" environment variable is required.');
}
$this->execute(getenv('MESSENGER_SQS_FIFO_QUEUE_DSN'));
}
public function testConnectionSendAndGet()
{
if (!getenv('MESSENGER_SQS_DSN')) {
| Group('integration')]
class AmazonSqsIntegrationTest extends TestCase
{
public function testConnectionSendToFifoQueueAndGet()
{
if (!getenv('MESSENGER_SQS_FIFO_QUEUE_DSN')) {
$this->markTestSkipped('Th | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsIntegrationTest.php",
"language": "php",
"file_size": 2884,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Fixtures\DummyMessage;
u... | erInterface;
class AmazonSqsSenderTest extends TestCase
{
public function testSend()
{
$envelope = new Envelope(new DummyMessage('Oy'));
$encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]];
$connecti | \AmazonSqs\Transport\AmazonSqsXrayTraceHeaderStamp;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Serialization\Serializ | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsSenderTest.php",
"language": "php",
"file_size": 3820,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Transport;
use AsyncAws\Core\Exception\Http\HttpException;
use AsyncAws\Core\Exception\Http\ServerException;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Fixtures\DummyMessage;
use S... | \Component\Messenger\Stamp\RedeliveryStamp;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\Component\Messenger\Transport\Receiver\ReceiverInterface;
use Symfony\Component\Messenger\Transport\Sender\SenderInterfac | ge\AmazonSqs\Transport\AmazonSqsTransport;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\TransportException;
use Symfony | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsTransportTest.php",
"language": "php",
"file_size": 8939,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\M... | BeanstalkdTransport implements TransportInterface, KeepaliveReceiverInterface, MessageCountAwareInterface
{
private SerializerInterface $serializer;
private BeanstalkdReceiver $receiver;
private BeanstalkdSender $sender;
public function __ | hpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Antonio Pauletich <antonio.pauletich95@gmail.com>
*/
class | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/BeanstalkdTransport.php",
"language": "php",
"file_size": 2397,
"cut_index": 563,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Transport;
use Pheanstalk\Contract\PheanstalkManagerInterface;
use Pheanstalk\Contract\PheanstalkPublisherInterface;
use Pheanstalk\Contract\PheanstalkSubscriberInterface;
use Pheanstalk\Contract\SocketFactoryInterface;
use Phean... | ULT_OPTIONS = [
'tube_name' => 'default',
'timeout' => 0,
'ttr' => 90,
'bury_on_reject' => false,
];
private TubeName $tube;
private int $timeout;
private int $ttr;
private bool $buryOnReject;
priva | \InvalidArgumentException;
use Symfony\Component\Messenger\Exception\TransportException;
/**
* @author Antonio Pauletich <antonio.pauletich95@gmail.com>
*
* @internal
*
* @final
*/
class Connection
{
private const DEFA | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/Connection.php",
"language": "php",
"file_size": 8565,
"cut_index": 716,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
use Doctrine\DBAL\Exception as DBALException;
use Doctrine\DBAL\Exception\RetryableException;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\LogicException;
use Symfony\Component\Mess... | Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
/**
* @author Vincent Touzet <vincent.touzet@gmail.com>
*/
class DoctrineReceiver implements ListableReceiverInterfac | nt\Messenger\Transport\Receiver\KeepaliveReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\ListableReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\ | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineReceiver.php",
"language": "php",
"file_size": 6274,
"cut_index": 716,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
use Doctrine\DBAL\Exception as DBALExcept... | izerInterface;
/**
* @author Vincent Touzet <vincent.touzet@gmail.com>
*/
class DoctrineSender implements SenderInterface
{
private SerializerInterface $serializer;
public function __construct(
private Connection $connection,
?S | tamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Sender\SenderInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Component\Messenger\Transport\Serialization\Serial | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineSender.php",
"language": "php",
"file_size": 1779,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBA... | port\PostgreSqlConnection;
/**
* This test checks on a postgres connection whether the doctrine asset filter works as expected.
*/
#[RequiresPhpExtension('pdo_pgsql')]
#[Group('integration')]
class DoctrinePostgreSqlFilterIntegrationTest extends TestCas | L\Tools\DsnParser;
use Doctrine\DBAL\Types\Type;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\Trans | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlFilterIntegrationTest.php",
"language": "php",
"file_size": 4081,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Middleware;
use Symfony\Component\Messenger\Bridge\... | areInterface
{
public function handle(Envelope $envelope, StackInterface $stack): Envelope
{
$message = $envelope->getMessage();
$messageGroupId = null;
$messageDeduplicationId = null;
if ($message instanceof Messag | ifoStamp;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Middleware\MiddlewareInterface;
use Symfony\Component\Messenger\Middleware\StackInterface;
final class AddFifoStampMiddleware implements Middlew | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Middleware/AddFifoStampMiddleware.php",
"language": "php",
"file_size": 1535,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Transport;
use PHPUnit\Framework\TestCase;
us... | is->assertTrue($factory->supports('sqs://localhost', []));
$this->assertTrue($factory->supports('https://sqs.us-east-2.amazonaws.com/123456789012/ab1-MyQueue-A2BCDEF3GHI4', []));
$this->assertFalse($factory->supports('redis://localhost', [] | nent\Messenger\Transport\Serialization\Serializer;
class AmazonSqsTransportFactoryTest extends TestCase
{
public function testSupportsOnlySqsTransports()
{
$factory = new AmazonSqsTransportFactory();
$th | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsTransportFactoryTest.php",
"language": "php",
"file_size": 1682,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Transport;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\LogicException;
use Symfony\Comp... | mponent\Messenger\Transport\Serialization\SerializerInterface;
/**
* @author Antonio Pauletich <antonio.pauletich95@gmail.com>
*/
class BeanstalkdReceiver implements KeepaliveReceiverInterface, MessageCountAwareInterface
{
private SerializerInterfac | mponent\Messenger\Transport\Receiver\KeepaliveReceiverInterface;
use Symfony\Component\Messenger\Transport\Receiver\MessageCountAwareInterface;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use Symfony\Co | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Transport/BeanstalkdReceiver.php",
"language": "php",
"file_size": 3312,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Fixtures\DummyMessage;... | r\Transport\Serialization\SerializerInterface;
final class BeanstalkdSenderTest extends TestCase
{
public function testSend()
{
$envelope = new Envelope(new DummyMessage('Oy'));
$encoded = ['body' => '...', 'headers' => ['type' => | ger\Bridge\Beanstalkd\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\DelayStamp;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenge | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/BeanstalkdSenderTest.php",
"language": "php",
"file_size": 3291,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Beanstalkd\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messe... | Component\Messenger\Transport\TransportInterface;
final class BeanstalkdTransportTest extends TestCase
{
public function testItIsATransport()
{
$transport = $this->getTransport();
$this->assertInstanceOf(TransportInterface::class, | port\BeanstalkdTransport;
use Symfony\Component\Messenger\Bridge\Beanstalkd\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\ | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Beanstalkd/Tests/Transport/BeanstalkdTransportTest.php",
"language": "php",
"file_size": 2597,
"cut_index": 563,
"middle_length": 229
} |
AL\Query\ForUpdate\ConflictResolutionMode;
use Doctrine\DBAL\Query\QueryBuilder;
use Doctrine\DBAL\Result;
use Doctrine\DBAL\Schema\AbstractSchemaManager;
use Doctrine\DBAL\Schema\NamedObject;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\DBAL\Schema\SchemaConfig;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPU... | eWillChangeItsStatus()
{
$queryBuilder = $this->getQueryBuilderStub();
$driverConnection = $this->getDBALConnection();
$stmt = $this->getGetResultMock([
'id' => 1,
'body' => '{"message":"Hi"}',
| e\Transport\Connection;
use Symfony\Component\Messenger\Exception\InvalidArgumentException;
use Symfony\Component\Messenger\Exception\TransportException;
class ConnectionTest extends TestCase
{
public function testGetAMessag | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php",
"language": "php",
"file_size": 32189,
"cut_index": 1331,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Tests\Fixtures\DummyMessage;
u... | Symfony\Component\Messenger\Transport\Serialization\Serializer;
use Symfony\Component\Serializer as SerializerComponent;
use Symfony\Component\Serializer\Encoder\JsonEncoder;
use Symfony\Component\Serializer\Normalizer\ObjectNormalizer;
class AmazonSqsRe | Bridge\AmazonSqs\Transport\Connection;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Exception\MessageDecodingFailedException;
use Symfony\Component\Messenger\Transport\Serialization\PhpSerializer;
use | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/AmazonSqsReceiverTest.php",
"language": "php",
"file_size": 5046,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Transport;
use Doctrine\DBAL\Platforms\PostgreSQLPlatform;
use Doctrine\Persis... | <vincent.touzet@gmail.com>
*
* @implements TransportFactoryInterface<DoctrineTransport>
*/
class DoctrineTransportFactory implements TransportFactoryInterface
{
public function __construct(
private ConnectionRegistry $registry,
priva | y\Component\Messenger\Transport\Serialization\SerializerInterface;
use Symfony\Component\Messenger\Transport\TransportFactoryInterface;
use Symfony\Component\Messenger\Transport\TransportInterface;
/**
* @author Vincent Touzet | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Transport/DoctrineTransportFactory.php",
"language": "php",
"file_size": 2743,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Doctrine\Tests\Transport;
use Doctrine\DBAL\Configuration;
use Doctrine\DBAL\Connection... | tests using PostgreSqlConnection with PgBouncer between pgsql and the application.
*/
#[RequiresPhpExtension('pdo_pgsql')]
#[Group('integration')]
class DoctrinePostgreSqlPgbouncerIntegrationTest extends TestCase
{
private Connection $driverConnection | utes\RequiresPhpExtension;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Messenger\Bridge\Doctrine\Tests\Fixtures\DummyMessage;
use Symfony\Component\Messenger\Bridge\Doctrine\Transport\PostgreSqlConnection;
/**
* This | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/DoctrinePostgreSqlPgbouncerIntegrationTest.php",
"language": "php",
"file_size": 2842,
"cut_index": 563,
"middle_length": 229
} |
ient;
use Symfony\Component\HttpClient\Response\MockResponse;
use Symfony\Component\Messenger\Bridge\AmazonSqs\Transport\Connection;
use Symfony\Component\Messenger\Exception\TransportException;
class ConnectionTest extends TestCase
{
public function testExtraOptions()
{
$this->expectException(\Invalid... | lue';
$awsSecret = 'some_aws_secret_value';
$region = 'eu-west-1';
$httpClient = new MockHttpClient();
$this->assertEquals(
new Connection(['queue_name' => 'queue'], new SqsClient(['region' => $region, 'accessKey | pectException(\InvalidArgumentException::class);
Connection::fromDsn('sqs://default/queue?extra_param=some_value');
}
public function testConfigureWithCredentials()
{
$awsKey = 'some_aws_access_key_va | {
"filepath": "src/Symfony/Component/Messenger/Bridge/AmazonSqs/Tests/Transport/ConnectionTest.php",
"language": "php",
"file_size": 26615,
"cut_index": 1331,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Messenger\Bridge\Redis\Tests\Transport;
use PHPUnit\Framework\TestCase;
use Sy... | ase
{
public function testSend()
{
$envelope = new Envelope(new DummyMessage('Oy'));
$encoded = ['body' => '...', 'headers' => ['type' => DummyMessage::class]];
$connection = $this->createMock(Connection::class);
$c | disSender;
use Symfony\Component\Messenger\Envelope;
use Symfony\Component\Messenger\Stamp\TransportMessageIdStamp;
use Symfony\Component\Messenger\Transport\Serialization\SerializerInterface;
class RedisSenderTest extends TestC | {
"filepath": "src/Symfony/Component/Messenger/Bridge/Redis/Tests/Transport/RedisSenderTest.php",
"language": "php",
"file_size": 1697,
"cut_index": 537,
"middle_length": 229
} |
p
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use Symfony\Component\Process\PhpSubproces... | e' => 'php', 'p' => 'Process'];
if ('Process' === $process) {
$p = new Process([$php, __DIR__.'/Fixtures/memory.php']);
} else {
$p = new PhpSubprocess([__DIR__.'/Fixtures/memory.php'], null, null, 60, [$php]);
}
$p->mustRun();
echo $p->getOutput | ['e' => $php, 'p' => $process] = getopt('e:p:') + [' | {
"filepath": "src/Symfony/Component/Process/Tests/OutputMemoryLimitProcess.php",
"language": "php",
"file_size": 828,
"cut_index": 516,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\PhpExecutableFinder;
/**
... | table PHP');
$this->assertEquals($current, $f->find(false), '::find() returns the executable PHP');
}
/**
* tests find() with the env var PHP_PATH.
*/
public function testFindArguments()
{
$f = new PhpExecutableFi | testFind()
{
$f = new PhpExecutableFinder();
$current = \PHP_BINARY;
$args = 'phpdbg' === \PHP_SAPI ? ' -qrr' : '';
$this->assertEquals($current.$args, $f->find(), '::find() returns the execu | {
"filepath": "src/Symfony/Component/Process/Tests/PhpExecutableFinderTest.php",
"language": "php",
"file_size": 2578,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Exception\LogicException;
u... | s->getOutput());
}
public function testCommandLine()
{
$process = new PhpProcess(<<<'PHP'
<?php echo phpversion().PHP_SAPI;
PHP
);
$commandLine = $process->getCommandLine();
$process->s | xpected = 'hello world!';
$process = new PhpProcess(<<<PHP
<?php echo '$expected';
PHP
);
$process->start();
$process->wait();
$this->assertEquals($expected, $proces | {
"filepath": "src/Symfony/Component/Process/Tests/PhpProcessTest.php",
"language": "php",
"file_size": 2361,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfon... | r')]
public function testSubprocess(string $processClass, string $memoryLimit, string $expectedMemoryLimit)
{
$process = new Process([self::$phpBin,
'-d',
'memory_limit='.$memoryLimit,
__DIR__.'/OutputMem | lass(): void
{
$phpBin = new PhpExecutableFinder();
self::$phpBin = getenv('SYMFONY_PROCESS_PHP_TEST_BINARY') ?: ('phpdbg' === \PHP_SAPI ? 'php' : $phpBin->find());
}
#[DataProvider('subprocessProvide | {
"filepath": "src/Symfony/Component/Process/Tests/PhpSubprocessTest.php",
"language": "php",
"file_size": 2185,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
define('ERR_SELECT_FAILED', 1);
define('ERR_TIMEOUT', 2);
define('ERR_READ_FAILED', 3);
define('ERR_WRITE_F... | if (in_array(\STDOUT, $w) && '' !== $out) {
$written = fwrite(\STDOUT, (string) $out, 32768);
if (false === $written) {
exit(ERR_WRITE_FAILED);
}
$out = (string) substr($out, $written);
}
if (null === $ | ile ($read || $write) {
$r = $read;
$w = $write;
$e = null;
$n = stream_select($r, $w, $e, 5);
if (false === $n) {
exit(ERR_SELECT_FAILED);
} elseif ($n < 1) {
exit(ERR_TIMEOUT);
}
| {
"filepath": "src/Symfony/Component/Process/Tests/PipeStdinInStdoutStdErrStreamSelect.php",
"language": "php",
"file_size": 1755,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Exception\ProcessFailedException;
use Symfony\Component\Process\Process;
/**
... | >expects($this->once())
->method('isSuccessful')
->willReturn(true);
$this->expectException(\InvalidArgumentException::class);
$this->expectExceptionMessage('Expected a failed process, but the given process was succ | l.
*/
public function testProcessFailedExceptionThrowsException()
{
$process = $this->getMockBuilder(Process::class)->onlyMethods(['isSuccessful'])->setConstructorArgs([['php']])->getMock();
$process- | {
"filepath": "src/Symfony/Component/Process/Tests/ProcessFailedExceptionTest.php",
"language": "php",
"file_size": 4667,
"cut_index": 614,
"middle_length": 229
} |
if (self::$process) {
self::$process->stop(0);
self::$process = null;
}
}
public function testInvalidCwd()
{
$this->expectException(RuntimeException::class);
$this->expectExceptionMessageMatches('/The provided cwd ".*" does not exist\./');
tr... | {
// An invalid command should not fail during start
$this->assertSame('\\' === \DIRECTORY_SEPARATOR ? 1 : 127, $process->run());
}
public static function invalidProcessProvider(): array
{
return [
[new Pr | $this->fail($e);
}
$cmd = new Process(['echo', 'test'], __DIR__.'/notfound/');
$cmd->run();
}
#[DataProvider('invalidProcessProvider')]
public function testInvalidCommand(Process $process)
| {
"filepath": "src/Symfony/Component/Process/Tests/ProcessTest.php",
"language": "php",
"file_size": 56319,
"cut_index": 2151,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Component\Process\Tests;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Exception\InvalidArgumentException;
use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;
class ProcessWindowsEnvBlockTest extends TestCase
{
... | ipped('Windows-only.');
}
$this->expectException(InvalidArgumentException::class);
$this->expectExceptionMessage('The environment block size (');
// "KEY=" (4) + 32767 + "\0" (1) + block terminator (1) = 32773 > 32767
| ST_BINARY') ?: ('phpdbg' === \PHP_SAPI ? 'php' : $phpBin->find());
}
public function testStartThrowsWhenSingleEnvValueExceedsWindowsLimit()
{
if ('\\' !== \DIRECTORY_SEPARATOR) {
$this->markTestSk | {
"filepath": "src/Symfony/Component/Process/Tests/ProcessWindowsEnvBlockTest.php",
"language": "php",
"file_size": 6527,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Tests\Messenger;
use PHPUnit\Framework\TestCase;
use Symfony\Component\Process\Exception\RunProc... | is->assertSame(0, $context->exitCode);
$this->assertStringContainsString(basename(__FILE__), $context->output);
}
public function testRunFailedProcess()
{
try {
(new RunProcessMessageHandler())(new RunProcessMessage | tCase
{
public function testRunSuccessfulProcess()
{
$context = (new RunProcessMessageHandler())(new RunProcessMessage(['ls'], __DIR__));
$this->assertSame(['ls'], $context->message->command);
$th | {
"filepath": "src/Symfony/Component/Process/Tests/Messenger/RunProcessMessageHandlerTest.php",
"language": "php",
"file_size": 2530,
"cut_index": 563,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Process\Messenger;
use Symfony\Component\Process\Process;
/**
* @author Kevin Bond <kevinbond@gmail.com>
*/
final class RunProcessContext
{
... | ->exitCode = $process->getExitCode();
$this->output = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getOutput();
$this->errorOutput = !$process->isStarted() || $process->isOutputDisabled() ? null : $process->getE | age,
Process $process,
) {
$this | {
"filepath": "src/Symfony/Component/Process/Messenger/RunProcessContext.php",
"language": "php",
"file_size": 936,
"cut_index": 606,
"middle_length": 52
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.