-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[InstallerBundle] Simplification and testing of sylius:install:setup command #3814
[InstallerBundle] Simplification and testing of sylius:install:setup command #3814
Conversation
d934a69
to
5f70ec2
Compare
@@ -0,0 +1,21 @@ | |||
@installer | |||
Feature: Sylius Install Feature | |||
In order to install Sylius |
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.
via CLI
e8f3725
to
80025b9
Compare
public function __construct() | ||
{ | ||
parent::__construct(); | ||
$this->application = new Application($this->getKernel()); |
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.
$this->getKernel()
returns null, anybody can suggest me, why? Any solutions? :D
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.
Seems like you've encountered an error! :)
Contexts are instantiated in ContextFactory
, exactly at line 80. They are initialized just one line below and KernelInterface
instance is set by Symfony2Extension context initializer.
To solve this you can register @BeforeScenario
hook (which has some downsides, especially that it would be called before every scenario in every suite that has CliContext
). One another solution is to create application and register that command on I run a command "sylius:install:setup"
step, which is cleaner and makes executing commands more isolated.
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.
Thanks @pamil !
@@ -118,6 +118,19 @@ default: | |||
filters: | |||
tags: "@homepage" | |||
|
|||
installer: | |||
contexts: | |||
- Behat\MinkExtension\Context\MinkContext |
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.
Do we need MinkContext in CLI?
0b73745
to
cfc27f7
Compare
@@ -118,6 +118,19 @@ default: | |||
filters: | |||
tags: "@homepage" | |||
|
|||
installer: |
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.
I'd call the suite cli
.
6208d17
to
bbab89b
Compare
635a8b2
to
688cc7a
Compare
@@ -3,4 +3,4 @@ | |||
|
|||
imports: | |||
- etc/behat/profiles.yml | |||
- etc/behat/suites.yml | |||
- etc/behat/suites.yml |
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.
Should be reverted
0089965
to
9a8cf8e
Compare
$channel->setCode($code); | ||
$channel->setName($code); | ||
$channel->setCode('DEFAULT'); | ||
$channel->setName('DEFAULT'); | ||
$channel->setColor(null); |
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.
Is it required?
29fdd5a
to
194a7f2
Compare
@michalmarcinkowski updated. |
$countryManager->persist($country); | ||
} | ||
$currency->setExchangeRate(1); | ||
$currency->setBase(true); |
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.
When I run this command twice with different currencies I will have two base currencies in the database... We should validate that (in a separate PR).
194a7f2
to
91c584e
Compare
$code = trim($code); | ||
$name = Intl::getRegionBundle()->getCountryName($code); | ||
$code = trim($code); | ||
$name = Intl::getCurrencyBundle()->getCurrencyName($code); |
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.
Maybe extract this line to service and inject it here?
91c584e
to
019c822
Compare
019c822
to
c138004
Compare
[InstallerBundle] Simplification and testing of sylius:install:setup command
Nice work Magda, thank you! 👍 |
Removed multiple currencies, languages, countries and channels configuration.
Now when the currency is chosen it is set as
base
.Added Behat testing of the command.