-
Notifications
You must be signed in to change notification settings - Fork 0
Add option - keepEmptyRows #128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,16 +116,6 @@ public function testAppRunMCF(): void | |
| } | ||
| } | ||
|
|
||
| public function testAppSegments(): void | ||
| { | ||
| $this->config['action'] = 'segments'; | ||
| $result = json_decode($this->runProcess()->getOutput(), true); | ||
|
|
||
| Assert::assertArrayHasKey('status', $result); | ||
| Assert::assertArrayHasKey('data', $result); | ||
| Assert::assertEquals('success', $result['status']); | ||
| } | ||
|
|
||
| public function testAppProfilesProperties(): void | ||
| { | ||
| $this->config = $this->getConfig('_empty'); | ||
|
|
@@ -154,50 +144,6 @@ public function testAppRunProperties(): void | |
| Assert::assertEquals(1, count($usersManifests)); | ||
| } | ||
|
|
||
| public function testAppUserException(): void | ||
| { | ||
| $this->config = $this->getConfig(); | ||
| $this->config['parameters']['retriesCount'] = 0; | ||
| // unset segment dimension to trigger API error | ||
| unset($this->config['parameters']['query']['dimensions'][1]); | ||
| $errorOutput = $this->runProcess()->getErrorOutput(); | ||
| Assert::assertStringContainsString('Expired or wrong credentials, please reauthorize.', $errorOutput); | ||
| } | ||
|
|
||
| public function testAppAuthException(): void | ||
| { | ||
| $this->config = $this->getConfig(); | ||
| $this->config['parameters']['retriesCount'] = 0; | ||
| $this->config['authorization']['oauth_api']['credentials'] = [ | ||
| 'appKey' => getenv('CLIENT_ID'), | ||
| '#appSecret' => getenv('CLIENT_SECRET'), | ||
| '#data' => json_encode([ | ||
| 'access_token' => 'cowshit', | ||
| 'refresh_token' => 'bullcrap', | ||
| ]), | ||
| ]; | ||
| $errorOutput = $this->runProcess()->getErrorOutput(); | ||
| Assert::assertStringContainsString('Expired or wrong credentials, please reauthorize.', $errorOutput); | ||
| } | ||
|
Comment on lines
-167
to
-181
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ale co je spatne na tomhle testu?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. volal se tam ještě starý endpoint na UA který už je dávno deprecated - https://github.com/keboola/google-analytics-extractor/actions/runs/16517331264/job/46710920611#step:4:663 |
||
|
|
||
| public function testRunSegmentsAction(): void | ||
| { | ||
| $this->config['action'] = 'segments'; | ||
| $process = $this->runProcess(); | ||
| Assert::assertEquals(0, $process->getExitCode()); | ||
|
|
||
| $output = json_decode($process->getOutput(), true); | ||
| Assert::assertArrayHasKey('status', $output); | ||
| Assert::assertArrayHasKey('data', $output); | ||
| Assert::assertEquals('success', $output['status']); | ||
| Assert::assertNotEmpty($output['data']); | ||
| $segment = $output['data'][0]; | ||
| Assert::assertArrayHasKey('id', $segment); | ||
| Assert::assertArrayHasKey('kind', $segment); | ||
| Assert::assertArrayHasKey('segmentId', $segment); | ||
| Assert::assertArrayHasKey('name', $segment); | ||
| } | ||
|
|
||
| private function runProcess(): Process | ||
| { | ||
| $fs = new Filesystem(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
testy pro odstraněný Universal Analytics, pomalu vypínají služby tak musíme odmazávat testy...chtělo by to teda pročistit i kod
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, tenhle test chapu, ten assert byl stejne divnej :D