@@ -116,16 +116,6 @@ public function testAppRunMCF(): void
116116 }
117117 }
118118
119- public function testAppSegments (): void
120- {
121- $ this ->config ['action ' ] = 'segments ' ;
122- $ result = json_decode ($ this ->runProcess ()->getOutput (), true );
123-
124- Assert::assertArrayHasKey ('status ' , $ result );
125- Assert::assertArrayHasKey ('data ' , $ result );
126- Assert::assertEquals ('success ' , $ result ['status ' ]);
127- }
128-
129119 public function testAppProfilesProperties (): void
130120 {
131121 $ this ->config = $ this ->getConfig ('_empty ' );
@@ -154,50 +144,6 @@ public function testAppRunProperties(): void
154144 Assert::assertEquals (1 , count ($ usersManifests ));
155145 }
156146
157- public function testAppUserException (): void
158- {
159- $ this ->config = $ this ->getConfig ();
160- $ this ->config ['parameters ' ]['retriesCount ' ] = 0 ;
161- // unset segment dimension to trigger API error
162- unset($ this ->config ['parameters ' ]['query ' ]['dimensions ' ][1 ]);
163- $ errorOutput = $ this ->runProcess ()->getErrorOutput ();
164- Assert::assertStringContainsString ('Expired or wrong credentials, please reauthorize. ' , $ errorOutput );
165- }
166-
167- public function testAppAuthException (): void
168- {
169- $ this ->config = $ this ->getConfig ();
170- $ this ->config ['parameters ' ]['retriesCount ' ] = 0 ;
171- $ this ->config ['authorization ' ]['oauth_api ' ]['credentials ' ] = [
172- 'appKey ' => getenv ('CLIENT_ID ' ),
173- '#appSecret ' => getenv ('CLIENT_SECRET ' ),
174- '#data ' => json_encode ([
175- 'access_token ' => 'cowshit ' ,
176- 'refresh_token ' => 'bullcrap ' ,
177- ]),
178- ];
179- $ errorOutput = $ this ->runProcess ()->getErrorOutput ();
180- Assert::assertStringContainsString ('Expired or wrong credentials, please reauthorize. ' , $ errorOutput );
181- }
182-
183- public function testRunSegmentsAction (): void
184- {
185- $ this ->config ['action ' ] = 'segments ' ;
186- $ process = $ this ->runProcess ();
187- Assert::assertEquals (0 , $ process ->getExitCode ());
188-
189- $ output = json_decode ($ process ->getOutput (), true );
190- Assert::assertArrayHasKey ('status ' , $ output );
191- Assert::assertArrayHasKey ('data ' , $ output );
192- Assert::assertEquals ('success ' , $ output ['status ' ]);
193- Assert::assertNotEmpty ($ output ['data ' ]);
194- $ segment = $ output ['data ' ][0 ];
195- Assert::assertArrayHasKey ('id ' , $ segment );
196- Assert::assertArrayHasKey ('kind ' , $ segment );
197- Assert::assertArrayHasKey ('segmentId ' , $ segment );
198- Assert::assertArrayHasKey ('name ' , $ segment );
199- }
200-
201147 private function runProcess (): Process
202148 {
203149 $ fs = new Filesystem ();
0 commit comments