forked from humanmade/S3-Uploads
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbootstrap.php
38 lines (29 loc) · 932 Bytes
/
bootstrap.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
<?php
/**
* Bootstrap the plugin unit testing environment.
*
* @package WordPress
* @subpackage JSON API
*/
require '/wp-phpunit/includes/functions.php';
function _manually_load_plugin() {
require dirname( __FILE__ ) . '/../s3-uploads.php';
}
tests_add_filter( 'muplugins_loaded', '_manually_load_plugin' );
tests_add_filter( 's3_uploads_s3_client_params', function ( array $params ) : array {
$params['endpoint'] = 'http://172.17.0.2:9000';
return $params;
} );
if ( getenv( 'S3_UPLOADS_BUCKET' ) ) {
define( 'S3_UPLOADS_BUCKET', getenv( 'S3_UPLOADS_BUCKET' ) );
}
if ( getenv( 'S3_UPLOADS_KEY' ) ) {
define( 'S3_UPLOADS_KEY', getenv( 'S3_UPLOADS_KEY' ) );
}
if ( getenv( 'S3_UPLOADS_SECRET' ) ) {
define( 'S3_UPLOADS_SECRET', getenv( 'S3_UPLOADS_SECRET' ) );
}
if ( getenv( 'S3_UPLOADS_REGION' ) ) {
define( 'S3_UPLOADS_REGION', getenv( 'S3_UPLOADS_REGION' ) );
}
require '/wp-phpunit/includes/bootstrap.php';