THRIFT-4459: reduce php library directory depth
Client: php
This closes #1471
diff --git a/lib/php/test/Test/Thrift/Fixtures.php b/lib/php/test/Fixtures.php
similarity index 100%
rename from lib/php/test/Test/Thrift/Fixtures.php
rename to lib/php/test/Fixtures.php
diff --git a/lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php b/lib/php/test/JsonSerialize/JsonSerializeTest.php
similarity index 96%
rename from lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php
rename to lib/php/test/JsonSerialize/JsonSerializeTest.php
index a6b0e7b..dfb34c3 100644
--- a/lib/php/test/Test/Thrift/JsonSerialize/JsonSerializeTest.php
+++ b/lib/php/test/JsonSerialize/JsonSerializeTest.php
@@ -23,10 +23,10 @@
use stdClass;
use Thrift\ClassLoader\ThriftClassLoader;
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
$loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages/phpjs');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages/phpjs');
$loader->register();
class JsonSerializeTest extends \PHPUnit_Framework_TestCase
diff --git a/lib/php/test/Makefile.am b/lib/php/test/Makefile.am
index c4dcde3..5658afa 100755
--- a/lib/php/test/Makefile.am
+++ b/lib/php/test/Makefile.am
@@ -35,16 +35,16 @@
all-local: deps
check-json-serializer: deps stubs
- $(PHPUNIT) --log-junit=TEST-json-serializer.xml Test/Thrift/JsonSerialize/
+ $(PHPUNIT) --log-junit=TEST-json-serializer.xml JsonSerialize/
check-validator: deps stubs
- php Test/Thrift/TestValidators.php
- php Test/Thrift/TestValidators.php -oop
+ php TestValidators.php
+ php TestValidators.php -oop
check-protocol: deps stubs
- $(PHPUNIT) --log-junit=TEST-log-json-protocol.xml Test/Thrift/Protocol/TestTJSONProtocol.php
- $(PHPUNIT) --log-junit=TEST-binary-serializer.xml Test/Thrift/Protocol/TestBinarySerializer.php
- $(PHPUNIT) --log-junit=TEST-log-simple-json-protocol.xml Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
+ $(PHPUNIT) --log-junit=TEST-log-json-protocol.xml Protocol/TestTJSONProtocol.php
+ $(PHPUNIT) --log-junit=TEST-binary-serializer.xml Protocol/TestBinarySerializer.php
+ $(PHPUNIT) --log-junit=TEST-log-simple-json-protocol.xml Protocol/TestTSimpleJSONProtocol.php
check: deps stubs \
check-protocol \
@@ -54,7 +54,3 @@
clean-local:
$(RM) -r ./packages
$(RM) TEST-*.xml
-
-EXTRA_DIST = \
- Test \
- TestValidators.thrift
diff --git a/lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php b/lib/php/test/Protocol/TestBinarySerializer.php
similarity index 92%
rename from lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php
rename to lib/php/test/Protocol/TestBinarySerializer.php
index b30cf3d..e08057b 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestBinarySerializer.php
+++ b/lib/php/test/Protocol/TestBinarySerializer.php
@@ -26,10 +26,10 @@
use Thrift\ClassLoader\ThriftClassLoader;
use Thrift\Serializer\TBinarySerializer;
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
$loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
$loader->register();
/***
diff --git a/lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php b/lib/php/test/Protocol/TestTJSONProtocol.php
similarity index 99%
rename from lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php
rename to lib/php/test/Protocol/TestTJSONProtocol.php
index a41b081..1c34efb 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestTJSONProtocol.php
+++ b/lib/php/test/Protocol/TestTJSONProtocol.php
@@ -30,10 +30,10 @@
define( 'BUFSIZ', 8192 ); //big enough to read biggest serialized Fixture arg.
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
$loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
$loader->register();
/***
diff --git a/lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php b/lib/php/test/Protocol/TestTSimpleJSONProtocol.php
similarity index 98%
rename from lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
rename to lib/php/test/Protocol/TestTSimpleJSONProtocol.php
index 5a8e9e6..1f696a5 100644
--- a/lib/php/test/Test/Thrift/Protocol/TestTSimpleJSONProtocol.php
+++ b/lib/php/test/Protocol/TestTSimpleJSONProtocol.php
@@ -30,10 +30,10 @@
define( 'BUFSIZ', 8192 ); //big enough to read biggest serialized Fixture arg.
-require_once __DIR__.'/../../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../../vendor/autoload.php';
$loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../../packages');
+$loader->registerDefinition('ThriftTest', __DIR__ . '/../packages');
$loader->register();
/***
diff --git a/lib/php/test/Test/Thrift/TestValidators.php b/lib/php/test/TestValidators.php
similarity index 94%
rename from lib/php/test/Test/Thrift/TestValidators.php
rename to lib/php/test/TestValidators.php
index a6c13c5..84c01f8 100644
--- a/lib/php/test/Test/Thrift/TestValidators.php
+++ b/lib/php/test/TestValidators.php
@@ -18,9 +18,9 @@
* under the License.
*/
-namespace Test\Thrift;
+namespace test\Thrift;
-require_once __DIR__.'/../../../../../vendor/autoload.php';
+require_once __DIR__.'/../../../vendor/autoload.php';
use Thrift\ClassLoader\ThriftClassLoader;
use Thrift\Exception\TProtocolException;
@@ -31,8 +31,8 @@
$GEN_DIR = $oop_mode ? 'phpvo' : 'phpv';
$loader = new ThriftClassLoader();
-$loader->registerDefinition('ThriftTest', __DIR__ . '/../../packages/' . $GEN_DIR);
-$loader->registerDefinition('TestValidators', __DIR__ . '/../../packages/' . $GEN_DIR);
+$loader->registerDefinition('ThriftTest', __DIR__ . '/packages/' . $GEN_DIR);
+$loader->registerDefinition('TestValidators', __DIR__ . '/packages/' . $GEN_DIR);
$loader->register();
// Would be nice to have PHPUnit here, but for now just hack it.