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

Set test env #4539

Closed
wants to merge 1 commit into from
Closed

Set test env #4539

wants to merge 1 commit into from

Conversation

boboldehampsink
Copy link
Contributor

@boboldehampsink boboldehampsink commented Jul 12, 2019

Config::$env is null when running tests. This makes it use the * environmental config values, and you can't set specific test config values.

This fixes that.

However I also feel that maybe https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L214-L218 could be merged with https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L247-L250 somehow (which already has the test env)

@codecov
Copy link

codecov bot commented Jul 12, 2019

Codecov Report

Merging #4539 into develop will decrease coverage by <.01%.
The diff coverage is 0%.

Impacted file tree graph

@@              Coverage Diff              @@
##             develop    #4539      +/-   ##
=============================================
- Coverage       31.6%   31.59%   -0.01%     
  Complexity     12827    12827              
=============================================
  Files            530      530              
  Lines          38472    38473       +1     
=============================================
- Hits           12159    12157       -2     
- Misses         26313    26316       +3
Impacted Files Coverage Δ Complexity Δ
src/test/TestSetup.php 0% <0%> (ø) 44 <0> (ø) ⬇️
src/services/Revisions.php 72.47% <0%> (-1.84%) 21% <0%> (ø)

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 29e189c...b600b3c. Read the comment docs.

@gtettelaar
Copy link
Contributor

gtettelaar commented Jul 12, 2019

However I also feel that maybe https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L214-L218 could be merged with https://github.com/craftcms/cms/blob/develop/src/test/TestSetup.php#L247-L250 somehow (which already has the test env)

@boboldehampsink
I agree. You can probably set the components.config key to the locally available $configService - and get rid of the array configuration obviously.

@brandonkelly brandonkelly requested a review from angrybrad July 12, 2019 23:08
@angrybrad
Copy link
Member

Fixed here, which should have the same effect and cleans up the duplication a bit as well: acd876e

@angrybrad angrybrad closed this Jul 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants