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

Non core fields dont work #3

Open
Skullywag opened this issue Mar 18, 2016 · 5 comments
Open

Non core fields dont work #3

Skullywag opened this issue Mar 18, 2016 · 5 comments

Comments

@Skullywag
Copy link

Im trying to use this extension to allow behat tests to create nodes on a remote server and have hit a stumbling block, it seems to work great until the list of fields being passed in the json contains a non core field. Things like "title", "author", "status" work fine, but adding a custom "long text" field breaks it with the error:

Fatal error: Class '\Drupal\Driver\Fields\Drupal7\DefaultHandler' not found in behat-drush-common.inc on line 41

Now there is a comment on the _drush_behat_get_field_handler_common function that i believe is relevant here but cant for the life of me figure it out, the Drupal 7 site in question itself is not managed by composer but all the behat stuff for it is. Im guessing I have to do something about the autoload.inc part but cant work that out.

Some more info that may or may not be useful is that the above is the command line erroring (the drush behat create-node command), when running the actual behat tests themselves with JUST core fields (the 3 mentioned above) I get:

Error: __clone method called on non-object in behat-drush-endpoint\behat.d7.drush.inc,

Any help would be greatly appreciated.

@Skullywag
Copy link
Author

Any movement on this? As far as I can see the recent fixes over at the Drupal driver have gotten this to work somewhat, but the issue above is still holding me and my team up from actually utilizing this. The main point being the __clone error when using custom fields.

@herrwalter
Copy link
Contributor

herrwalter commented Oct 28, 2016

Hi,

I also got this Error. Got past it by including the autoloader generated by the composer.json used by the https://behat-drupal-extension.readthedocs.io/en/master/globalinstall.html

Also added the composer projects defined in this readme

Sadly ran into a new one:

PHP Fatal error:  Declaration of Drush\Command\DrushInputAdapter::hasParameterOption() must be compatible with Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in phar:///var/www/vbp/public_html/drush/lib/Drush/Command/DrushInputAdapter.php on line 27
Drush command terminated abnormally due to an unrecoverable error.                                                                                                      [error]
Error: Declaration of Drush\Command\DrushInputAdapter::hasParameterOption() must be compatible with
Symfony\Component\Console\Input\InputInterface::hasParameterOption($values, $onlyParams = false) in
phar:///var/www/vbp/public_html/drush/lib/Drush/Command/DrushInputAdapter.php, line 27

Can you help me out?

Do I need to include other projects?

@herrwalter
Copy link
Contributor

herrwalter commented Oct 31, 2016

So, I resolved this error by downgrading to Drush 7.
Using this composer.json:

{
    "require": {
        "drush/drush": "7.*",
        "drush-ops/behat-drush-endpoint": "^0.0.4",
        "symfony/config": "^3.1",
        "symfony/expression-language": "^3.1",
        "symfony/proxy-manager-bridge": "^3.1"
    },
    "config": {
        "bin-dir": "/usr/local/bin"
    }
}

Require the autoloading in your settings.php
Run drush cc drush
And everything works.

This is a workaround. With drush 8 im still facing the issue, I'd like to be able to be on the lastest drush version. So still want a solution for the error above.

EDIT: well, it works with drush 8.* as well (8.1.7). Im confused now

@drupol
Copy link

drupol commented Nov 13, 2016

I also have this problem when using Drush 8.1.7 and Behat 3.2.2.

@greg-1-anderson
Copy link
Member

Regarding the error message above, does this happen when using a global Drush? Try installing Drush as part of your Drupal site and see if it works better.

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

4 participants