See title, patch coming in a minute.

You need to use Settings::get() now.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir’s picture

Status: Active » Needs review
FileSize
802 bytes
dstol’s picture

Title: settings() has been removed [d8] » [d8] settings() has been removed and VERSION constant removed
dstol’s picture

Couple other updates necessary to keep up to date with D8, was having issues with the patch in #1.

dstol’s picture

Berdir’s picture

How are you adding drupalextension?

I'm doing it with composer_manager, which now somehow integrates it's own autoload.php and the one from core, so that the code can be loaded. That also avoids duplicating libraries that are already in core. behat is running just fine with my patch for me.

  • Commit 9c3db44 on master authored by Berdir, committed by jhedstrom:
    Issue #2229747 by Berdir: [d8] settings() has been removed and VERSION...
jhedstrom’s picture

Status: Needs review » Fixed

I've committed #1 in 9c3db44. I'd like more info before I change how the autoload works and the version is detected, since Composer's autoload.php should work.

Let's follow up in another issue.

dstol’s picture

I started to create a follow up below, but it was my own mistake. Either way, thanks for commiting #1.

----

In creating a brief poc for [#8648731] I ran into some issues resulting in patch, #3, in #2229747: [d8] settings() has been removed and VERSION constant removed

My setup was D8 at 3d856f30. I took the following steps:

  1. patch to include some testing libraries below
  2. `composer update -dev`
  3. `./core/vendor/bin/behat --init`
  4. Edit FeatureContext to extend from DrupalContext
  5. Add basic feature
  6. Add basic behat.yml
  7. `./core/vendor/bin/behat -vvv` which epic failed

First exception: [Drupal\Exception\BootstrapException] Unable to determine Drupal core version. Supported versions are 6, 7, and 8. Realizing now I was specifying *, which grabs 0.1.5 in composer.json vs dev-master, this appears to be fixed.

Second fatal: PHP Fatal error: Call to undefined function Drupal\Driver\Cores\settings(), which I resolved by updating to the new syntax and namespacing it out fully. dev-master is behind at f3263f4, which fetching HEAD updates the autoloader properly and resolves this.

diff --git composer.json composer.json
index 4526a90..fe487f3 100644
--- composer.json
+++ composer.json
@@ -25,6 +25,11 @@
     "phpunit/phpunit": "3.7.*",
     "zendframework/zend-feed": "2.2.*"
   },
+  "require-dev": {
+    "drupal/drupal-extension": "dev-master",
+    "behat/mink-extension": "*",
+    "behat/mink-selenium2-driver": "*"
+  },
   "autoload": {
     "psr-0": {
       "Drupal\\Core": "core/lib/",
grasmash’s picture

This file references 'core/includes/session.inc', which doesn't seem to existing anymore. Hm.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

  • Commit 9c3db44 on master, 1.0 authored by Berdir, committed by jhedstrom:
    Issue #2229747 by Berdir: [d8] settings() has been removed and VERSION...

  • Commit 9c3db44 on master, 1.0, test-symfony authored by Berdir, committed by jhedstrom:
    Issue #2229747 by Berdir: [d8] settings() has been removed and VERSION...