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

composer bootstrap v4 really needs PhpBrowser? #5806

Closed
zdenekgebauer opened this issue Jan 2, 2020 · 5 comments
Closed

composer bootstrap v4 really needs PhpBrowser? #5806

zdenekgebauer opened this issue Jan 2, 2020 · 5 comments

Comments

@zdenekgebauer
Copy link

@zdenekgebauer zdenekgebauer commented Jan 2, 2020

What are you trying to achieve?

Boostrap new tests without unused modules

What do you get instead?

In ModuleContainer.php line 110:
                                                        
  Module PhpBrowser is not installed.                   
  Use Composer to install corresponding package:        
                                                        
  composer require codeception/module-phpbrowser --dev  

Steps to reproduce:

  1. create new composer. json with
  "require-dev": {
    "codeception/codeception": "^4.0",
    "codeception/module-asserts": "^1.1"
  }
  1. run composer install
  2. run vendor\bin\codecept bootsrap

Details

  • Codeception version:
  • PHP Version: 7.3
  • Operating System: Windows 10
  • Installation type: Composer
  • List of installed packages (composer show)
  • Suite configuration:

Presence of PhpBrowser shouldn't be checked during boostrap. Some projects do not require acceptance nor functional tests, they require only unit test

@zdenekgebauer zdenekgebauer changed the title composer boostrap v4 really needs PhpBrowser? composer bootstrap v4 really needs PhpBrowser? Jan 2, 2020
@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jan 2, 2020

@zdenekgebauer If you only want unit suite, use codecept init unit instead of codecept bootstrap.

Though bootstrap really requires some testing and bug fixing.

@zdenekgebauer
Copy link
Author

@zdenekgebauer zdenekgebauer commented Jan 2, 2020

Yes, this is little confusing:

  • module Db is not required on bootstrap. Error about missing module appears after adding module to .yml and running test
  • module Asserts is also required on bootstrap

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jan 8, 2020

Two issues here.

  1. Modules should be installed before creating suites: https://github.com/Codeception/Codeception/blob/4.0.1/src/Codeception/Template/Bootstrap.php#L42-L48
  2. Even if the modules are installed before creating suite (codecept init unit does it in the right order), createHelper method tries to load newly created Helper class, and the error that you got above happens, because modules weren't installed when vendor/autoload.php file was loaded. I will try to reload it.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jan 9, 2020

Actually createHelper is fine, it is createActor which breaks bootstrap.

@Naktibalda
Copy link
Member

@Naktibalda Naktibalda commented Jan 14, 2020

I released patch as 4.0.2

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

No branches or pull requests

2 participants