Skip to content

Commit 833fa07

Browse files
committed
WIP
1 parent 5f1086c commit 833fa07

File tree

2 files changed

+0
-180
lines changed

2 files changed

+0
-180
lines changed

app/Queue.php

Lines changed: 0 additions & 130 deletions
This file was deleted.

tests/Unit/ExampleTest.php

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -14,54 +14,4 @@ public function test_that_true_is_true(): void
1414
{
1515
$this->assertTrue(true);
1616
}
17-
18-
public function testMessageCanBeDispatchedAndReceived()
19-
{
20-
// Создание экземпляра класса Queue
21-
$queue = new Queue('test');
22-
23-
// Создание фиктивного действия при получении сообщения
24-
$action = function (string $message, int $type) {
25-
$this->assertEquals('Hello, world!', $message);
26-
$this->assertEquals(1, $type);
27-
};
28-
29-
// Отправка сообщения в очередь
30-
$queue->dispatch('Hello, world!');
31-
32-
// Получение сообщения из очереди
33-
$queue->listen($action);
34-
}
35-
36-
public function testMessageCanBeDispatchedAndReceived2()
37-
{
38-
// Создание экземпляра класса Queue
39-
$queue = new Queue('test');
40-
// $queue->clear();
41-
42-
// Создание фиктивного действия при получении сообщения
43-
$action = function () {
44-
$this->assertTrue(true);
45-
};
46-
47-
// Отправка сообщения в очередь
48-
$queue->dispatchClosure($action);
49-
50-
// Получение сообщения из очереди
51-
$queue->listenClosure($action);
52-
}
53-
54-
public function testFailedMessageReceive()
55-
{
56-
// Создание экземпляра класса Queue
57-
$queue = new Queue('test');
58-
59-
// Создание фиктивного действия в случае ошибки при получении сообщения
60-
$failedAction = function ($error) {
61-
$this->fail('Failed to receive a message: '.$error);
62-
};
63-
64-
// Получение сообщения из очереди с указанием несуществующего типа сообщения
65-
// $queue->listen(function () {}, $failedAction);
66-
}
6717
}

0 commit comments

Comments
 (0)