1010use Interop \Queue \PsrMessage ;
1111use PHPUnit \Framework \TestCase ;
1212use Symfony \Component \EventDispatcher \GenericEvent ;
13- use Symfony \Component \HttpKernel \Kernel ;
1413
1514class PhpSerializerEventTransformerTest extends TestCase
1615{
@@ -28,10 +27,6 @@ public function testCouldBeConstructedWithoutAnyArguments()
2827
2928 public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage ()
3029 {
31- if (version_compare (Kernel::VERSION , '3.0 ' , '< ' )) {
32- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
33- }
34-
3530 $ transformer = new PhpSerializerEventTransformer ($ this ->createContextStub ());
3631
3732 $ event = new GenericEvent ('theSubject ' );
@@ -45,10 +40,6 @@ public function testShouldReturnMessageWithPhpSerializedEventAsBodyOnToMessage()
4540
4641 public function testShouldReturnEventUnserializedFromMessageBodyOnToEvent ()
4742 {
48- if (version_compare (Kernel::VERSION , '3.0 ' , '< ' )) {
49- $ this ->markTestSkipped ('This functionality only works on Symfony 3.0 or higher ' );
50- }
51-
5243 $ message = new NullMessage ();
5344 $ message ->setBody (serialize (new GenericEvent ('theSubject ' )));
5445
@@ -60,34 +51,6 @@ public function testShouldReturnEventUnserializedFromMessageBodyOnToEvent()
6051 $ this ->assertEquals ('theSubject ' , $ event ->getSubject ());
6152 }
6253
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-
9154 /**
9255 * @return \PHPUnit_Framework_MockObject_MockObject|PsrContext
9356 */
0 commit comments