/
AllTests.php
51 lines (40 loc) · 1.31 KB
/
AllTests.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
if (!defined('PHPUnit_MAIN_METHOD')) {
define('PHPUnit_MAIN_METHOD', 'Services_Amazon_S3_AllTests::main');
}
require_once 'PHPUnit/Autoload.php';
require_once dirname(__FILE__) . '/Test.php';
require_once dirname(__FILE__) . '/StreamTest.php';
$configFile = dirname(__FILE__) . '/config.php';
if (file_exists($configFile)) {
include_once $configFile;
}
class Services_Amazon_S3_AllTests extends PHPUnit_Framework_TestSuite
{
public static function main()
{
PHPUnit_TextUI_TestRunner::run(self::suite());
}
protected function setUp()
{
// These constants must be set in order to run the tests
if (!defined('ACCESS_KEY_ID') || !defined('SECRET_ACCESS_KEY')
|| !ACCESS_KEY_ID || !SECRET_ACCESS_KEY
) {
$this->markTestSuiteSkipped('Credentials missing in config.php');
}
}
public static function suite()
{
$suite = new Services_Amazon_S3_AllTests('Services_Amazon_S3 Tests');
$suite->addTestSuite('Services_Amazon_S3_Test');
$suite->addTestSuite('Services_Amazon_S3_StreamTest');
return $suite;
}
}
// exec test suite
if (PHPUnit_MAIN_METHOD == 'Services_Amazon_S3_AllTests::main') {
Services_Amazon_S3_AllTests::main();
}
?>