Skip to content
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

Feature/tests #302

Merged
merged 9 commits into from
Jun 28, 2022
Merged

Feature/tests #302

merged 9 commits into from
Jun 28, 2022

Conversation

iruzevic
Copy link
Member

Description

  • fixing and updating tests

@iruzevic iruzevic added bugfix A report on a possible bug in the code tests Issue regarding tests labels Jun 13, 2022
@iruzevic iruzevic requested a review from dingo-d June 13, 2022 12:14
@iruzevic iruzevic self-assigned this Jun 13, 2022
@codecov
Copy link

codecov bot commented Jun 13, 2022

Codecov Report

Merging #302 (7a74c7f) into develop (7d5f17c) will increase coverage by 1.22%.
The diff coverage is 100.00%.

@@              Coverage Diff              @@
##             develop     #302      +/-   ##
=============================================
+ Coverage      79.74%   80.97%   +1.22%     
+ Complexity      1187     1186       -1     
=============================================
  Files            131      131              
  Lines           3584     3584              
=============================================
+ Hits            2858     2902      +44     
+ Misses           726      682      -44     
Flag Coverage Δ
unittests 80.97% <100.00%> (+1.22%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
src/Geolocation/AbstractGeolocation.php 98.18% <100.00%> (+80.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7d5f17c...7a74c7f. Read the comment docs.

@iruzevic iruzevic requested a review from a team June 13, 2022 12:17
@@ -4,7 +4,6 @@
"system",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you check which ones are being redefined from BrainMonkey when and just remove the ones we are not mocking?

@@ -201,6 +222,7 @@ private function getGeolocation(): string
$ipAddr = $this->getIpAddress();
}


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slip?

tests/Helpers.php Outdated Show resolved Hide resolved
Copy link
Collaborator

@dingo-d dingo-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some minor comments, great job 👍🏼

Comment on lines +110 to +113
$mock->shouldReceive('setCookie')->withArgs(function (string $name, string $value) {
putenv("ES_SIDEAFFECT={$name}");
putenv("ES_SIDEAFFECT_ADDITIONAL={$value}");
});
Copy link
Collaborator

@mbmjertan mbmjertan Jun 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should probably return in closures when using withArgs, see http://docs.mockery.io/en/latest/reference/expectations.html?highlight=withArgs#argument-matching-with-closures

@iruzevic iruzevic merged commit 0caa764 into develop Jun 28, 2022
@iruzevic iruzevic deleted the feature/tests branch June 28, 2022 10:19
iruzevic added a commit that referenced this pull request Jun 28, 2022
* develop:
  Feature/tests (#302)
  Add lock true to composer json config

# Conflicts:
#	src/Geolocation/AbstractGeolocation.php
#	tests/Blocks/BlockVariationCliTest.php
#	tests/Geolocation/AbstractGeolocationTest.php
#	tests/Helpers.php
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix A report on a possible bug in the code tests Issue regarding tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants