10
10
use Interop \Queue \PsrMessage ;
11
11
use PHPUnit \Framework \TestCase ;
12
12
use Symfony \Component \EventDispatcher \GenericEvent ;
13
- use Symfony \Component \HttpKernel \Kernel ;
14
13
15
14
class PhpSerializerEventTransformerTest extends TestCase
16
15
{
@@ -28,10 +27,6 @@ public function testCouldBeConstructedWithoutAnyArguments()
28
27
29
28
public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage ()
30
29
{
31
- if (version_compare (Kernel::VERSION , '3.0 ' , '< ' )) {
32
- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
33
- }
34
-
35
30
$ transformer = new PhpSerializerEventTransformer ($ this ->createContextStub ());
36
31
37
32
$ event = new GenericEvent ('theSubject ' );
@@ -45,10 +40,6 @@ public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage()
45
40
46
41
public function testShouldReturnEventUnserializedFromMessageBodyOnToEvent ()
47
42
{
48
- if (version_compare (Kernel::VERSION , '3.0 ' , '< ' )) {
49
- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
50
- }
51
-
52
43
$ message = new NullMessage ();
53
44
$ message ->setBody (serialize (new GenericEvent ('theSubject ' )));
54
45
@@ -60,34 +51,6 @@ public function testShouldReturnEventUnserializedFromMessageBodyOnToEvent()
60
51
$ this ->assertEquals ('theSubject ' , $ event ->getSubject ());
61
52
}
62
53
63
- public function testThrowNotSupportedExceptionOnSymfonyPrior30OnToMessage ()
64
- {
65
- if (version_compare (Kernel::VERSION , '3.0 ' , '>= ' )) {
66
- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
67
- }
68
-
69
- $ this ->expectException (\LogicException::class);
70
- $ this ->expectExceptionMessage ('This transformer does not work on Symfony prior 3.0. ' );
71
-
72
- $ transformer = new PhpSerializerEventTransformer ($ this ->createContextStub ());
73
-
74
- $ transformer ->toMessage (new GenericEvent ());
75
- }
76
-
77
- public function testThrowNotSupportedExceptionOnSymfonyPrior30OnToEvent ()
78
- {
79
- if (version_compare (Kernel::VERSION , '3.0 ' , '>= ' )) {
80
- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
81
- }
82
-
83
- $ this ->expectException (\LogicException::class);
84
- $ this ->expectExceptionMessage ('This transformer does not work on Symfony prior 3.0. ' );
85
-
86
- $ transformer = new PhpSerializerEventTransformer ($ this ->createContextStub ());
87
-
88
- $ transformer ->toEvent ('anEvent ' , new NullMessage ());
89
- }
90
-
91
54
/**
92
55
* @return \PHPUnit_Framework_MockObject_MockObject|PsrContext
93
56
*/
0 commit comments