Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated tests to use composer

  • Loading branch information...
commit ba42d3b26a1ae7d6ce11d2f6b735a958451409b7 1 parent 1adf53d
@kriswallsmith authored
Showing with 39 additions and 19 deletions.
  1. +4 −1 .gitignore
  2. +24 −0 composer.json
  3. +0 −1  phpunit.xml.dist
  4. +11 −17 test/bootstrap.php
View
5 .gitignore
@@ -1 +1,4 @@
-phpunit.xml
+composer.lock
+composer.phar
+phpunit.xml
+vendor
View
24 composer.json
@@ -0,0 +1,24 @@
+{
+ "name": "kriswallsmith/buzz-extensions",
+ "description": "Extensions for PHP's lightweight HTTP client",
+ "keywords": ["http client", "curl"],
+ "homepage": "https://github.com/kriswallsmith/BuzzExtension",
+ "type": "library",
+ "license": "MIT",
+ "authors": [
+ {
+ "name": "Kris Wallsmith",
+ "email": "kris.wallsmith@gmail.com",
+ "homepage": "http://kriswallsmith.net/"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0",
+ "kriswallsmith/buzz": ">=0.7"
+ },
+ "autoload": {
+ "psr-0": {
+ "Buzz\\Extension": "lib/"
+ }
+ }
+}
View
1  phpunit.xml.dist
@@ -8,7 +8,6 @@
</testsuites>
<php>
- <!-- <server name="BUZZ_DIR" value="/path/to/buzz/lib" /> -->
<!-- <server name="UPS_ACCESS_LICENSE_NUMBER" value="" /> -->
<!-- <server name="UPS_USER_ID" value="" /> -->
<!-- <server name="UPS_PASSWORD" value="" /> -->
View
28 test/bootstrap.php
@@ -1,21 +1,15 @@
<?php
-if (!isset($_SERVER['BUZZ_DIR'])) {
- throw new RuntimeException('You must specify a BUZZ_DIR environment variable.');
-}
+if (!$loader = @include __DIR__.'/../vendor/autoload.php') {
+ echo <<<EOM
+You must set up the project dependencies by running the following commands:
+
+ curl -s http://getcomposer.org/installer | php
+ php composer.phar install
-spl_autoload_register(function($class)
-{
- if (0 === strpos($class, 'Buzz\\Extension\\')) {
- $dir = __DIR__.'/../lib';
- } elseif (0 === strpos($class, 'Buzz\\')) {
- $dir = $_SERVER['BUZZ_DIR'];
- } else {
- return false;
- }
+EOM;
+
+ exit(1);
+}
- if (file_exists($file = $dir.'/'.str_replace('\\', '/', $class).'.php')) {
- require_once $file;
- return true;
- }
-});
+$loader->add('Buzz\Test\Extension', __DIR__);
Please sign in to comment.
Something went wrong with that request. Please try again.