Drupal Dump

Drupal Snippets, Hacks and more....

Using GIT with drupal7, do not put core into GIT

This is tutorial how to setup a drupal 7 site with git but without putting drupal core into git, reason is that you don't need it in git unless you are patching core. As drupal core is always the same and updated with drush, version control is not needed at least there is a stream of opinion that goes into that direction.  So what do you do, you only put sites folder into git.

Drush download drupal 7 into the current directory

For drupal 8 you will probably use more complex framework with composer at leas but for drupal 7 you still might use drush just to download drupal core. So to do that into the current directory you are at, use this command

drush dl drupal-7.x --drupal-project-rename="../${PWD##*/}" -y

It will overrun everything you have in that directory.

Logging arrays with logger

In drupal 8 for logging we use logger service, to log array data in some readable format, you should use little hack like in drupal 7 adding html code and print_r to array.

First drush driver behat test

With drush driver for behat you will have some more power, basically drush power to do things. So to make out first drush test, you will need to bring some change in behat.yml file and change some lines.

Behat - log in to a site using only blackbox driver

This just another simple test for behat and mink combo with plain blackbox driver. To log in to a site and do check some behavior you can write this simple test, again no PHP needed for it. You will be logged in and checking what is on people admin page. Add it to your some.feature file and run behat.