THRIFT-4474: Use PSR-4 autoloader by default

Client: php

This closes #1479
diff --git a/lib/php/test/Protocol/BinarySerializerTest.php b/lib/php/test/Protocol/BinarySerializerTest.php
index 7e87280..71b0bb5 100644
--- a/lib/php/test/Protocol/BinarySerializerTest.php
+++ b/lib/php/test/Protocol/BinarySerializerTest.php
@@ -24,10 +24,9 @@
 namespace Test\Thrift\Protocol;
 
 use PHPUnit\Framework\TestCase;
-use Thrift\ClassLoader\ThriftClassLoader;
 use Thrift\Serializer\TBinarySerializer;
 
-require_once __DIR__ . '/../../../../vendor/autoload.php';
+require __DIR__ . '/../../../../vendor/autoload.php';
 
 /***
  * This test suite depends on running the compiler against the
@@ -42,9 +41,9 @@
 {
     public function setUp()
     {
-        $loader = new ThriftClassLoader();
-        $loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
-        $loader->register();
+        /** @var \Composer\Autoload\ClassLoader $loader */
+        $loader = require __DIR__ . '/../../../../vendor/autoload.php';
+        $loader->addPsr4('', __DIR__ . '/../packages/php');
     }
 
     /**
diff --git a/lib/php/test/Protocol/TJSONProtocolTest.php b/lib/php/test/Protocol/TJSONProtocolTest.php
index bab4389..bf0ecce 100644
--- a/lib/php/test/Protocol/TJSONProtocolTest.php
+++ b/lib/php/test/Protocol/TJSONProtocolTest.php
@@ -25,11 +25,10 @@
 
 use PHPUnit\Framework\TestCase;
 use Test\Thrift\Fixtures;
-use Thrift\ClassLoader\ThriftClassLoader;
 use Thrift\Protocol\TJSONProtocol;
 use Thrift\Transport\TMemoryBuffer;
 
-require_once __DIR__ . '/../../../../vendor/autoload.php';
+require __DIR__ . '/../../../../vendor/autoload.php';
 
 /***
  * This test suite depends on running the compiler against the
@@ -47,9 +46,9 @@
 
     public static function setUpBeforeClass()
     {
-        $loader = new ThriftClassLoader();
-        $loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
-        $loader->register();
+        /** @var \Composer\Autoload\ClassLoader $loader */
+        $loader = require __DIR__ . '/../../../../vendor/autoload.php';
+        $loader->addPsr4('', __DIR__ . '/../packages/php');
 
         Fixtures::populateTestArgs();
         TJSONProtocolFixtures::populateTestArgsJSON();
diff --git a/lib/php/test/Protocol/TSimpleJSONProtocolTest.php b/lib/php/test/Protocol/TSimpleJSONProtocolTest.php
index ec64321..e4a1373 100644
--- a/lib/php/test/Protocol/TSimpleJSONProtocolTest.php
+++ b/lib/php/test/Protocol/TSimpleJSONProtocolTest.php
@@ -25,11 +25,10 @@
 
 use PHPUnit\Framework\TestCase;
 use Test\Thrift\Fixtures;
-use Thrift\ClassLoader\ThriftClassLoader;
 use Thrift\Protocol\TSimpleJSONProtocol;
 use Thrift\Transport\TMemoryBuffer;
 
-require_once __DIR__ . '/../../../../vendor/autoload.php';
+require __DIR__ . '/../../../../vendor/autoload.php';
 
 /***
  * This test suite depends on running the compiler against the
@@ -47,9 +46,10 @@
 
     public static function setUpBeforeClass()
     {
-        $loader = new ThriftClassLoader();
-        $loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
-        $loader->register();
+
+        /** @var \Composer\Autoload\ClassLoader $loader */
+        $loader = require __DIR__ . '/../../../../vendor/autoload.php';
+        $loader->addPsr4('', __DIR__ . '/../packages/php');
 
         Fixtures::populateTestArgs();
         TSimpleJSONProtocolFixtures::populateTestArgsSimpleJSON();