Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-13761

Bootstrap: Use root_path with __DIR__ to get the correct path

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Invalid
    • Icon: Minor Minor
    • None
    • 3.1.4-RC1
    • Test Suite
    • None
    • Windows 8.1, Visual Studio 2013 + PHPTools for Visual Studio
      PHP 5.4.24, MySQL 5.5, Chrome 39.0.2171.71 m

      When using PHPUnit tests with some IDE, there can be error with the tests suites.

      My IDE for example has its own PHPUnit integrated. When I execute the phpunit.xml.dist then, it loads the boostrap, finds line
      $phpbb_root_path = '/phpBB/';
      and load the require_once() files after that from the wrong folder, cause they are relative to the file wich is executed first.

      My suggested solution is using
      $phpbb_root_path = _DIR_ . '/../phpBB/';
      _DIR_ is shortand for the directory where the current file (so bootstrap.php) is placed.

            Marc Marc
            Wolfsblvt Wolfsblvt [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: