2929class HooksCreateResponseTest extends TestCase
3030{
3131 private HooksCreateResponse $ createResponseCreate ;
32- private HooksCreateResponse $ createResponseError ;
33- private HooksCreateResponse $ createResponseExisting ;
34- private HooksCreateResponse $ createResponseNoHookId ;
32+ private HooksCreateResponse $ createResponseFailedError ;
33+ private HooksCreateResponse $ createResponseCreateExisting ;
3534
3635 public function setUp (): void
3736 {
3837 parent ::setUp ();
3938
4039 $ fixtures = new Fixtures ();
4140
42- $ xmlCreate = $ fixtures ->fromXmlFile ('hooks_create.xml ' );
43- $ xmlCreateError = $ fixtures ->fromXmlFile ('hooks_create_error.xml ' );
44- $ xmlCreateExisting = $ fixtures ->fromXmlFile ('hooks_create_existing.xml ' );
45- $ xmlCreateNoHookId = $ fixtures ->fromXmlFile ('hooks_create_no_hook_id.xml ' );
41+ $ xmlCreate = $ fixtures ->fromXmlFile ('hooks_create.xml ' );
42+ $ xmlCreateExisting = $ fixtures ->fromXmlFile ('hooks_create_existing.xml ' );
43+ $ xmlCreateFailedError = $ fixtures ->fromXmlFile ('hooks_create_failed_error.xml ' );
4644
47- $ this ->createResponseCreate = new HooksCreateResponse ($ xmlCreate );
48- $ this ->createResponseError = new HooksCreateResponse ($ xmlCreateError );
49- $ this ->createResponseExisting = new HooksCreateResponse ($ xmlCreateExisting );
50- $ this ->createResponseNoHookId = new HooksCreateResponse ($ xmlCreateNoHookId );
45+ $ this ->createResponseCreate = new HooksCreateResponse ($ xmlCreate );
46+ $ this ->createResponseCreateExisting = new HooksCreateResponse ($ xmlCreateExisting );
47+ $ this ->createResponseFailedError = new HooksCreateResponse ($ xmlCreateFailedError );
5148 }
5249
5350 public function testHooksCreateResponseCreateContent (): void
@@ -63,35 +60,24 @@ public function testHooksCreateResponseCreateContent(): void
6360
6461 public function testHooksCreateResponseErrorContent (): void
6562 {
66- $ this ->assertEquals ('FAILED ' , $ this ->createResponseError ->getReturnCode ());
67- $ this ->assertEquals ('createHookError ' , $ this ->createResponseError ->getMessageKey ());
68- $ this ->assertFalse ($ this ->createResponseError ->success ());
69- $ this ->assertTrue ($ this ->createResponseError ->failed ());
70- $ this ->assertNull ($ this ->createResponseError ->getHookId ());
71- $ this ->assertNull ($ this ->createResponseError ->isPermanentHook ());
72- $ this ->assertNull ($ this ->createResponseError ->hasRawData ());
63+ $ this ->assertEquals ('FAILED ' , $ this ->createResponseFailedError ->getReturnCode ());
64+ $ this ->assertEquals ('createHookError ' , $ this ->createResponseFailedError ->getMessageKey ());
65+ $ this ->assertFalse ($ this ->createResponseFailedError ->success ());
66+ $ this ->assertTrue ($ this ->createResponseFailedError ->failed ());
67+ $ this ->assertNull ($ this ->createResponseFailedError ->getHookId ());
68+ $ this ->assertNull ($ this ->createResponseFailedError ->isPermanentHook ());
69+ $ this ->assertNull ($ this ->createResponseFailedError ->hasRawData ());
7370 }
7471
7572 public function testHooksCreateResponseExistingContent (): void
7673 {
77- $ this ->assertEquals ('SUCCESS ' , $ this ->createResponseExisting ->getReturnCode ());
78- $ this ->assertEquals ('duplicateWarning ' , $ this ->createResponseExisting ->getMessageKey ());
79- $ this ->assertTrue ($ this ->createResponseExisting ->success ());
80- $ this ->assertFalse ($ this ->createResponseExisting ->failed ());
81- $ this ->assertEquals (1 , $ this ->createResponseExisting ->getHookId ());
82- $ this ->assertNull ($ this ->createResponseExisting ->isPermanentHook ());
83- $ this ->assertNull ($ this ->createResponseExisting ->hasRawData ());
84- }
85-
86- public function testHooksCreateResponseNoHookIdContent (): void
87- {
88- $ this ->assertEquals ('FAILED ' , $ this ->createResponseNoHookId ->getReturnCode ());
89- $ this ->assertEquals ('missingParamHookID ' , $ this ->createResponseNoHookId ->getMessageKey ());
90- $ this ->assertFalse ($ this ->createResponseNoHookId ->success ());
91- $ this ->assertTrue ($ this ->createResponseNoHookId ->failed ());
92- $ this ->assertNull ($ this ->createResponseNoHookId ->getHookId ());
93- $ this ->assertNull ($ this ->createResponseNoHookId ->isPermanentHook ());
94- $ this ->assertNull ($ this ->createResponseNoHookId ->hasRawData ());
74+ $ this ->assertEquals ('SUCCESS ' , $ this ->createResponseCreateExisting ->getReturnCode ());
75+ $ this ->assertEquals ('duplicateWarning ' , $ this ->createResponseCreateExisting ->getMessageKey ());
76+ $ this ->assertTrue ($ this ->createResponseCreateExisting ->success ());
77+ $ this ->assertFalse ($ this ->createResponseCreateExisting ->failed ());
78+ $ this ->assertEquals (1 , $ this ->createResponseCreateExisting ->getHookId ());
79+ $ this ->assertNull ($ this ->createResponseCreateExisting ->isPermanentHook ());
80+ $ this ->assertNull ($ this ->createResponseCreateExisting ->hasRawData ());
9581 }
9682
9783 public function testHooksCreateResponseTypes (): void
@@ -100,14 +86,11 @@ public function testHooksCreateResponseTypes(): void
10086 $ this ->assertEachGetterValueIsInteger ($ this ->createResponseCreate , ['getHookId ' ]);
10187 $ this ->assertEachGetterValueIsBoolean ($ this ->createResponseCreate , ['isPermanentHook ' , 'hasRawData ' ]);
10288
103- $ this ->assertEachGetterValueIsString ($ this ->createResponseError , ['getReturnCode ' ]);
104- $ this ->assertEachGetterValueIsNull ($ this ->createResponseError , ['getHookId ' , 'isPermanentHook ' , 'hasRawData ' ]);
105-
106- $ this ->assertEachGetterValueIsString ($ this ->createResponseExisting , ['getReturnCode ' ]);
107- $ this ->assertEachGetterValueIsInteger ($ this ->createResponseExisting , ['getHookId ' ]);
108- $ this ->assertEachGetterValueIsNull ($ this ->createResponseExisting , ['isPermanentHook ' , 'hasRawData ' ]);
89+ $ this ->assertEachGetterValueIsString ($ this ->createResponseFailedError , ['getReturnCode ' ]);
90+ $ this ->assertEachGetterValueIsNull ($ this ->createResponseFailedError , ['getHookId ' , 'isPermanentHook ' , 'hasRawData ' ]);
10991
110- $ this ->assertEachGetterValueIsString ($ this ->createResponseNoHookId , ['getReturnCode ' ]);
111- $ this ->assertEachGetterValueIsNull ($ this ->createResponseNoHookId , ['getHookId ' , 'isPermanentHook ' , 'hasRawData ' ]);
92+ $ this ->assertEachGetterValueIsString ($ this ->createResponseCreateExisting , ['getReturnCode ' ]);
93+ $ this ->assertEachGetterValueIsInteger ($ this ->createResponseCreateExisting , ['getHookId ' ]);
94+ $ this ->assertEachGetterValueIsNull ($ this ->createResponseCreateExisting , ['isPermanentHook ' , 'hasRawData ' ]);
11295 }
11396}
0 commit comments