File tree Expand file tree Collapse file tree 3 files changed +14
-6
lines changed
appengine/standard/mailgun Expand file tree Collapse file tree 3 files changed +14
-6
lines changed Original file line number Diff line number Diff line change 2020$ app = new Application ();
2121
2222$ app ->get ('/ ' , function () use ($ app ) {
23- if ($ app ['mailgun.domain ' ] == 'MAILGUN_DOMAIN_NAME ' ) {
23+ if ($ app ['mailgun.domain ' ] == 'MAILGUN_DOMAIN ' ) {
2424 return 'set your mailgun domain and API key in <code>index.php</code> ' ;
2525 }
2626
Original file line number Diff line number Diff line change 2222$ app = require __DIR__ . '/app.php ' ;
2323
2424// set your Mailgun domain name and API key
25- $ app ['mailgun.domain ' ] = 'MAILGUN_DOMAIN_NAME ' ;
25+ $ app ['mailgun.domain ' ] = 'MAILGUN_DOMAIN ' ;
2626$ app ['mailgun.api_key ' ] = 'MAILGUN_APIKEY ' ;
2727
2828// Run the app!
Original file line number Diff line number Diff line change @@ -23,21 +23,29 @@ class DeployAppEngineFlexTest extends \PHPUnit_Framework_TestCase
2323{
2424 use AppEngineDeploymentTrait;
2525
26- public function beforeDeploy ()
26+ public static function beforeDeploy ()
2727 {
28+ // set your Mailgun domain name and API key
29+ $ mailgunDomain = getenv ('MAILGUN_DOMAIN ' );
30+ $ mailgunApiKey = getenv ('MAILGUN_APIKEY ' );
31+
32+ if (empty ($ mailgunDomain ) || empty ($ mailgunApiKey )) {
33+ self ::markTestSkipped ('set the MAILGUN_DOMAIN and MAILGUN_APIKEY environment variables ' );
34+ }
35+
2836 $ tmpDir = FileUtil::cloneDirectoryIntoTmp (__DIR__ . '/.. ' );
2937 FileUtil::copyDir (__DIR__ . '/../../../flexible/mailgun ' , $ tmpDir );
3038 self ::$ gcloudWrapper ->setDir ($ tmpDir );
3139 chdir ($ tmpDir );
3240 $ indexPhp = file_get_contents ('index.php ' );
3341 $ indexPhp = str_replace (
34- 'MAILGUN_DOMAIN_NAME ' ,
35- getenv ( ' MAILGUN_DOMAIN_NAME ' ) ,
42+ 'MAILGUN_DOMAIN ' ,
43+ $ mailgunDomain ,
3644 $ indexPhp
3745 );
3846 $ indexPhp = str_replace (
3947 'MAILGUN_APIKEY ' ,
40- getenv ( ' MAILGUN_APIKEY ' ) ,
48+ $ mailgunApiKey ,
4149 $ indexPhp
4250 );
4351 file_put_contents ('index.php ' , $ indexPhp );
You can’t perform that action at this time.
0 commit comments