Skip to content

Commit d8d2b4c

Browse files
author
Takashi Matsuo
committed
Merge pull request GoogleCloudPlatform#55 from GoogleCloudPlatform/testutil
Adding testutils with a simple testing sample.
2 parents a9801a9 + 8d271d9 commit d8d2b4c

File tree

14 files changed

+2443
-1
lines changed

14 files changed

+2443
-1
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ env:
3232
before_install:
3333
- php dump_credentials.php
3434
- wget http://get.sensiolabs.org/php-cs-fixer.phar -O php-cs-fixer.phar
35-
- scripts/install_test_deps.sh
35+
- testing/install_test_deps.sh
3636

3737
script:
3838
# run php-cs-fixer

appengine/standard/modules/app.php

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
2+
/**
3+
* Copyright 2016 Google Inc.
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
18+
use Silex\Application;
19+
// [START import]
20+
use google\appengine\api\modules\ModulesService;
21+
22+
// [END import]
23+
24+
// create the Silex application
25+
$app = new Application();
26+
27+
$app->get('/', function () use ($app) {
28+
// [START modules_methods]
29+
$module = ModulesService::getCurrentModuleName();
30+
$instance = ModulesService::getCurrentInstanceId();
31+
// [END modules_methods]
32+
return "$module:$instance";
33+
});
34+
35+
return $app;

appengine/standard/modules/app.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
runtime: php55
2+
api_version: 1
3+
4+
handlers:
5+
- url: /.*
6+
script: index.php
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"require": {
3+
"silex/silex": "^1.3"
4+
},
5+
"require-dev": {
6+
"phpunit/phpunit": "~4",
7+
"symfony/browser-kit": "~3",
8+
"symfony/process": "~3",
9+
"guzzlehttp/guzzle": "~6.0"
10+
},
11+
"autoload": {
12+
"psr-4": { "Google\\Cloud\\Test\\": "tests/" }
13+
}
14+
}

0 commit comments

Comments
 (0)