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

Parameters token replacement with complex structure #3339

Closed
neoascetic opened this issue Jul 15, 2016 · 5 comments
Closed

Parameters token replacement with complex structure #3339

neoascetic opened this issue Jul 15, 2016 · 5 comments
Labels

Comments

@neoascetic
Copy link
Contributor

@neoascetic neoascetic commented Jul 15, 2016

Given settings.yml containing

api:
  db:
    host: 127.0.0.1
    database: db
    username: user
    password: pass

and codeception.yml containing

params:
  - settings.yml

I want acceptance.yml parameters replacement

modules:
  enabled:
    - Db:
        dsn: 'mysql:host=%api.db.host%;dbname=%api.db.database%'
        user: '%api.db.username%'
        password: '%api.db.password%'

resulting in

modules:
  enabled:
    - Db:
        dsn: 'mysql:host=127.0.0.1;dbname=db'
        user: user
        password: pass
@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jul 20, 2016

@DavertMik This is a feature request for Codeception\Util\Template.

I think that template parsing is not a responsibility of Codeception and it would be better to use a third party template parser. However the last template engine I have used was Smarty 1.x so I can't recommend anything.

@neoascetic
Copy link
Contributor Author

@neoascetic neoascetic commented Jul 20, 2016

Furthermore, import statements for Symphony configs don't work.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jul 20, 2016

@neoascetic Please report it as a separate issue

@DavertMik
Copy link
Member

@DavertMik DavertMik commented Jul 22, 2016

import statements for Symphony configs don't work.

yes. They are not. They are not part of yaml format, actually.

@neoascetic could you look into Codeception\Util\Template and provide a patch so it could use arrays with dots as parameters? I don't think that would be hard to implement this. Thanks

@neoascetic
Copy link
Contributor Author

@neoascetic neoascetic commented Jul 26, 2016

yes. They are not. They are not part of yaml format, actually.

I know that, but docs are saying about "Symfony format" and fact that import statement isn't supported is a little bit misleading

Naktibalda added a commit that referenced this issue Jul 28, 2016
Dot notation for params replacement. Fixes #3339
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.