From: Daniel Beyer <dabe@deb.ymc.ch>
Date: Wed, 30 Sep 2015 08:08:45 +0200
Subject: FrameworkBundle+SecurityBundle: Don't try to include legacy autoload
 files

The AppKernel.php used for some functional tests still tries to load
./autoload.php(.dist), which is no longer shipped with Symfony in favour
of using vendor/autoload.php.

This is harmless for the normal testsuite, but becomes problematic for the
Debian packaging of Symfony:
In Debian the autoloading for Symfony currently does not make use of
composer's autoloading mechanism. Instead an own autoloading is implemented,
that uses phpab to generate autoload.php files for each single component,
bride and bundle. Since AppKernel.php, which is provided for functional tests
in FrameworkBundle and SecurityBundle would load those generated autoload.php
files instead of /vendor/autoload.php, the testsuite fails for the Debian
packaging. Additionally for DEP-8 (as-installed) tests not including
vendor/autoload.php means, that instead of installed classes, classes from
the source code are loaded, which is wrong.

Example for tests in the Symfony SecurityBundle:
Instead of loading [SYMFONY]/vendor.autoload.php, the file
[SYMFONY]/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php
would load [SYMFONY]/src/Symfony/Bundle/SecurityBundle/autoload.php without
this patch, making the tests fail.

Forwarded: no
---
 .../Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php  | 10 ----------
 .../Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php   | 10 ----------
 2 files changed, 20 deletions(-)

diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php
index b07d44f..004ec3e 100644
--- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php
+++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/AppKernel.php
@@ -17,16 +17,6 @@ $lastDir = null;
 while ($dir !== $lastDir) {
     $lastDir = $dir;
 
-    if (file_exists($dir.'/autoload.php')) {
-        require_once $dir.'/autoload.php';
-        break;
-    }
-
-    if (file_exists($dir.'/autoload.php.dist')) {
-        require_once $dir.'/autoload.php.dist';
-        break;
-    }
-
     if (file_exists($dir.'/vendor/autoload.php')) {
         require_once $dir.'/vendor/autoload.php';
         break;
diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php
index b828c5a..d81da67 100644
--- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php
+++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php
@@ -17,16 +17,6 @@ $lastDir = null;
 while ($dir !== $lastDir) {
     $lastDir = $dir;
 
-    if (is_file($dir.'/autoload.php')) {
-        require_once $dir.'/autoload.php';
-        break;
-    }
-
-    if (is_file($dir.'/autoload.php.dist')) {
-        require_once $dir.'/autoload.php.dist';
-        break;
-    }
-
     if (file_exists($dir.'/vendor/autoload.php')) {
         require_once $dir.'/vendor/autoload.php';
         break;
