Provide method for setting backupGlobals #3045

Merged
merged 4 commits into from May 30, 2016

Conversation

Projects
None yet
3 participants
@mkeasling
Contributor

mkeasling commented Apr 28, 2016

This address issue #3044

Pass the backup_globals variable, if provided in the .yml file, to the test suite.

Provide method for setting backupGlobals
Pass the backup_globals variable, if provided in the .yml file, to the test suite.
@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik Apr 29, 2016

Member

Ok, I got your point but I'd like to improve the implementation:

Please add backup_globals parameter to the configuration https://github.com/Codeception/Codeception/blob/2.1/src%2FCodeception%2FConfiguration.php#L88

So you won't need to check for isset as you always receive default values from the global config.

also could you add this parameter to reference? https://github.com/Codeception/Codeception/blob/2.1/docs%2Freference%2FConfiguration.md

Member

DavertMik commented Apr 29, 2016

Ok, I got your point but I'd like to improve the implementation:

Please add backup_globals parameter to the configuration https://github.com/Codeception/Codeception/blob/2.1/src%2FCodeception%2FConfiguration.php#L88

So you won't need to check for isset as you always receive default values from the global config.

also could you add this parameter to reference? https://github.com/Codeception/Codeception/blob/2.1/docs%2Freference%2FConfiguration.md

@mkeasling

This comment has been minimized.

Show comment
Hide comment
@mkeasling

mkeasling May 4, 2016

Contributor

Great feedback; thank you!

I've addressed your requests; please let me know if there's anything else I can do to improve this.

Contributor

mkeasling commented May 4, 2016

Great feedback; thank you!

I've addressed your requests; please let me know if there's anything else I can do to improve this.

src/Codeception/SuiteManager.php
@@ -142,6 +142,9 @@ protected function createSuite($name)
$name = $this->settings['namespace'] . ".$name";
}
$suite->setName($name);
+ if (isset($this->settings['backup_globals'])) {
+ $suite->setBackupGlobals(boolval($this->settings['backup_globals']));

This comment has been minimized.

@Naktibalda

Naktibalda May 4, 2016

Member

boolval method was added in PHP 5.5, please use (bool) cast instead.

@Naktibalda

Naktibalda May 4, 2016

Member

boolval method was added in PHP 5.5, please use (bool) cast instead.

@DavertMik

This comment has been minimized.

Show comment
Hide comment
@DavertMik

DavertMik May 30, 2016

Member

Thanks!

Member

DavertMik commented May 30, 2016

Thanks!

@DavertMik DavertMik merged commit e1ade34 into Codeception:2.1 May 30, 2016

4 checks passed

Scrutinizer No new issues
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
semaphoreci The build passed on Semaphore.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment