<?php error_reporting(-1); date_default_timezone_set('UTC'); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . '/composer.lock')) { die("Dependencies must be installed using composer:\n\nphp composer.phar install\n\n" . "See http://getcomposer.org for help with installing composer\n"); } // Include the composer autoloader $loader = (require dirname(__DIR__) . '/vendor/autoload.php'); $loader->add('Ctc\\Test', __DIR__); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . '/mock'); // Emit deprecation warnings Guzzle\Common\Version::$emitWarnings = true;
<?php error_reporting(E_ALL | E_STRICT); // Ensure that composer has installed all dependencies if (!file_exists(dirname(__DIR__) . DIRECTORY_SEPARATOR . 'composer.lock')) { die("Dependencies must be installed using composer:\n\ncomposer.phar install --dev\n\n" . "See https://github.com/composer/composer/blob/master/README.md for help with installing composer\n"); } require_once 'PHPUnit/TextUI/TestRunner.php'; // Register an autoloader for the client being tested spl_autoload_register(function ($class) { if (0 === strpos($class, 'CMV\\GoogleBooks')) { $class = str_replace('CMV\\GoogleBooks', '', $class); if ('\\' != DIRECTORY_SEPARATOR) { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'CMV/GoogleBooks' . DIRECTORY_SEPARATOR . str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php'; } else { $class = dirname(__DIR__) . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'CMV\\GoogleBooks' . DIRECTORY_SEPARATOR . $class . '.php'; } if (file_exists($class)) { require $class; return true; } } return false; }); // Include the composer autoloader $loader = (require_once dirname(__DIR__) . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'); // Register services with the GuzzleTestCase Guzzle\Tests\GuzzleTestCase::setMockBasePath(__DIR__ . DIRECTORY_SEPARATOR . 'mock'); Guzzle\Tests\GuzzleTestCase::setServiceBuilder(Guzzle\Service\Builder\ServiceBuilder::factory(array('client' => array('class' => 'CMV\\GoogleBooks\\GoogleBooksClient'))));