Skip to content

Commit 5dd292c

Browse files
authored
feat: add php 8.0 kokoro tests, remove php 7.2 (GoogleCloudPlatform#1269)
(recreating to refresh kokoro builds)
1 parent 44f66f7 commit 5dd292c

File tree

149 files changed

+1066
-1046
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

149 files changed

+1066
-1046
lines changed

.kokoro/php72.cfg renamed to .kokoro/php80.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Configure the docker image for kokoro-trampoline.
44
env_vars: {
55
key: "TRAMPOLINE_IMAGE"
6-
value: "gcr.io/cloud-devrel-kokoro-resources/php72"
6+
value: "gcr.io/cloud-devrel-kokoro-resources/php80"
77
}
88

99
# Give the docker image a unique project ID and credentials per PHP version

appengine/flexible/analytics/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public function testIndex()
2929
$resp = $this->client->get('/');
3030
$this->assertEquals('200', $resp->getStatusCode(),
3131
'top page status code');
32-
$this->assertContains('returned 200', (string) $resp->getBody(),
32+
$this->assertStringContainsString('returned 200', (string) $resp->getBody(),
3333
'top page content');
3434
}
3535
}

appengine/flexible/analytics/test/LocalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class LocalTest extends WebTestCase
2222
{
23-
public function setUp()
23+
public function setUp(): void
2424
{
2525
parent::setUp();
2626
$this->client = $this->createClient();

appengine/flexible/datastore/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ public function testIndex()
3030
$this->assertEquals('200', $resp->getStatusCode(),
3131
'top page status code');
3232

33-
$this->assertContains("Last 10 visits:", (string) $resp->getBody());
33+
$this->assertStringContainsString("Last 10 visits:", (string) $resp->getBody());
3434
}
3535
}

appengine/flexible/datastore/test/LocalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class LocalTest extends WebTestCase
2222
{
23-
public function setUp()
23+
public function setUp(): void
2424
{
2525
parent::setUp();
2626
$this->client = $this->createClient();
@@ -43,6 +43,6 @@ public function testIndex()
4343
$client->request('GET', '/');
4444
$this->assertTrue($client->getResponse()->isOk());
4545
$text = $client->getResponse()->getContent();
46-
$this->assertContains("Last 10 visits:", $text);
46+
$this->assertStringContainsString("Last 10 visits:", $text);
4747
}
4848
}

appengine/flexible/drupal8/test/DeployTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function testContacts()
115115
'top page status code'
116116
);
117117
$content = $resp->getBody()->getContents();
118-
$this->assertContains('Website feedback', $content);
119-
$this->assertContains('Drupal', $content);
118+
$this->assertStringContainsString('Website feedback', $content);
119+
$this->assertStringContainsString('Drupal', $content);
120120
}
121121
}

appengine/flexible/helloworld/test/ControllersTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testTopPage()
4040
$crawlerexport = $client->request('GET', '/');
4141
$resp = $client->getResponse();
4242
$this->assertTrue($resp->isOk());
43-
$this->assertContains('Hello World', $resp->getContent());
43+
$this->assertStringContainsString('Hello World', $resp->getContent());
4444
}
4545

4646
public function testGoodbye()
@@ -49,6 +49,6 @@ public function testGoodbye()
4949
$crawlerexport = $client->request('GET', '/goodbye');
5050
$resp = $client->getResponse();
5151
$this->assertTrue($resp->isOk());
52-
$this->assertContains('Goodbye World', $resp->getContent());
52+
$this->assertStringContainsString('Goodbye World', $resp->getContent());
5353
}
5454
}

appengine/flexible/helloworld/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testIndex()
3232
$resp = $this->client->get('/');
3333
$this->assertEquals('200', $resp->getStatusCode(),
3434
'index status code');
35-
$this->assertContains('Hello World', (string) $resp->getBody(),
35+
$this->assertStringContainsString('Hello World', (string) $resp->getBody(),
3636
'index content');
3737
}
3838
}

appengine/flexible/laravel/test/DeployDatabaseSessionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,6 @@ public function testHomepage()
111111
'top page status code'
112112
);
113113
$content = $resp->getBody()->getContents();
114-
$this->assertContains('Laravel', $content);
114+
$this->assertStringContainsString('Laravel', $content);
115115
}
116116
}

appengine/flexible/laravel/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function testHomepage()
109109
'top page status code'
110110
);
111111
$content = $resp->getBody()->getContents();
112-
$this->assertContains('Laravel', $content);
112+
$this->assertStringContainsString('Laravel', $content);
113113
}
114114

115115
public function testNormalLog()

appengine/flexible/logging/test/DeployTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class DeployTest extends TestCase
2727
use AppEngineDeploymentTrait;
2828
use EventuallyConsistentTestTrait;
2929

30-
public function setUp()
30+
public function setUp(): void
3131
{
3232
if (!getenv('TRAVIS_SECURE_ENV_VARS')) {
3333
$this->markTestSkipped('No secret available');
@@ -41,7 +41,7 @@ public function testIndex()
4141
$this->assertEquals('200', $resp->getStatusCode(),
4242
'top page status code');
4343

44-
$this->assertContains("Logs:", (string) $resp->getBody());
44+
$this->assertStringContainsString("Logs:", (string) $resp->getBody());
4545
}
4646
public function testAsyncLog()
4747
{

appengine/flexible/logging/test/LocalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
class LocalTest extends WebTestCase
2222
{
23-
public function setUp()
23+
public function setUp(): void
2424
{
2525
if (!getenv('GOOGLE_PROJECT_ID')) {
2626
$this->markTestSkipped('Must set GOOGLE_PROJECT_ID');
@@ -43,7 +43,7 @@ public function testSomeLogs()
4343
$response = $this->client->getResponse();
4444
$this->assertEquals(200, $response->getStatusCode());
4545
$text = $response->getContent();
46-
$this->assertContains("Logs:", $text);
46+
$this->assertStringContainsString("Logs:", $text);
4747
}
4848

4949
public function testAsyncLog()

appengine/flexible/memcache/test/LocalTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
class LocalTest extends WebTestCase
2323
{
24-
public function setUp()
24+
public function setUp(): void
2525
{
2626
parent::setUp();
2727
$this->client = $this->createClient();

appengine/flexible/storage/test/LocalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class LocalTest extends WebTestCase
2020
{
21-
public function setUp()
21+
public function setUp(): void
2222
{
2323
if (!getenv('GOOGLE_PROJECT_ID')) {
2424
$this->markTestSkipped('Must set GOOGLE_PROJECT_ID');
@@ -73,6 +73,6 @@ public function testWrite()
7373
$crawler = $client->followRedirect();
7474
$response = $client->getResponse();
7575
$this->assertEquals(200, $response->getStatusCode());
76-
$this->assertContains($time, $response->getContent());
76+
$this->assertStringContainsString($time, $response->getContent());
7777
}
7878
}

appengine/flexible/symfony/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ public function testHomepage()
125125
'top page status code'
126126
);
127127
$content = $resp->getBody()->getContents();
128-
$this->assertContains('Your application is now ready', $content);
128+
$this->assertStringContainsString('Your application is now ready', $content);
129129
}
130130

131131
public function testErrorLog()

appengine/flexible/tasks/test/LocalTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
class LocalTest extends WebTestCase
2020
{
21-
public function setUp()
21+
public function setUp(): void
2222
{
2323
parent::setUp();
2424
$this->client = $this->createClient();
@@ -44,7 +44,7 @@ public function testHome()
4444
$crawler = $client->request('GET', '/');
4545
$response = $client->getResponse();
4646
$this->assertTrue($client->getResponse()->isOk());
47-
$this->assertContains('Hello World', $response->getContent());
47+
$this->assertStringContainsString('Hello World', $response->getContent());
4848
}
4949

5050
public function testLogPayload()
@@ -53,6 +53,6 @@ public function testLogPayload()
5353
$crawler = $client->request('POST', '/example_task_handler', [], [], [], 'google');
5454
$response = $client->getResponse();
5555
$this->assertEquals(200, $response->getStatusCode());
56-
$this->assertContains(sprintf('Received task with payload: google'), $response->getContent());
56+
$this->assertStringContainsString(sprintf('Received task with payload: google'), $response->getContent());
5757
}
5858
}

appengine/flexible/tasks/test/createTaskTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class tasksTest extends TestCase
3232
protected static $queue;
3333
protected static $location;
3434

35-
public static function setUpBeforeClass()
35+
public static function setUpBeforeClass(): void
3636
{
3737
self::$queue = self::requireEnv('CLOUD_TASKS_APPENGINE_QUEUE');
3838
self::$location = self::requireEnv('CLOUD_TASKS_LOCATION');
@@ -51,6 +51,6 @@ public function testCreateTask()
5151
self::$queue
5252
);
5353
$expectedOutput = sprintf('Created task %s', $taskNamePrefix);
54-
$this->assertContains($expectedOutput, $output);
54+
$this->assertStringContainsString($expectedOutput, $output);
5555
}
5656
}

appengine/flexible/twilio/test/DeployTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function testReceiveCall()
4646
$response = $this->client->request('POST', '/call/receive');
4747
$this->assertEquals(200, $response->getStatusCode());
4848
$body = $response->getBody()->getContents();
49-
$this->assertContains('Hello from Twilio!', $body);
49+
$this->assertStringContainsString('Hello from Twilio!', $body);
5050
}
5151

5252
public function testReceiveSms()
@@ -60,8 +60,8 @@ public function testReceiveSms()
6060
]);
6161
$this->assertEquals(200, $response->getStatusCode());
6262
$body = $response->getBody()->getContents();
63-
$this->assertContains($params['From'], $body);
64-
$this->assertContains($params['Body'], $body);
63+
$this->assertStringContainsString($params['From'], $body);
64+
$this->assertStringContainsString($params['Body'], $body);
6565
}
6666

6767
public function testSendSms()

appengine/flexible/twilio/test/LocalTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function testReceiveCall()
5252
$crawler = $client->request('POST', '/call/receive');
5353
$response = $client->getResponse();
5454
$this->assertEquals(200, $response->getStatusCode());
55-
$this->assertContains(
55+
$this->assertStringContainsString(
5656
'Hello from Twilio!',
5757
$response->getContent()
5858
);
@@ -68,8 +68,8 @@ public function testReceiveSms()
6868
$crawler = $client->request('POST', '/sms/receive', $params);
6969
$response = $client->getResponse();
7070
$this->assertEquals(200, $response->getStatusCode());
71-
$this->assertContains($params['From'], $response->getContent());
72-
$this->assertContains($params['Body'], $response->getContent());
71+
$this->assertStringContainsString($params['From'], $response->getContent());
72+
$this->assertStringContainsString($params['Body'], $response->getContent());
7373
}
7474

7575
public function testSendSms()
@@ -81,6 +81,6 @@ public function testSendSms()
8181
$crawler = $client->request('POST', '/sms/send', $params);
8282
$response = $client->getResponse();
8383
$this->assertEquals(200, $response->getStatusCode());
84-
$this->assertContains('Hello from Twilio!', $response->getContent());
84+
$this->assertStringContainsString('Hello from Twilio!', $response->getContent());
8585
}
8686
}

appengine/flexible/websockets/test/system_test.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LocalTest extends TestCase
2828
{
2929
protected $loop;
3030

31-
protected function setUp()
31+
protected function setUp(): void
3232
{
3333
$this->loop = EventLoop\Factory::create();
3434

@@ -56,7 +56,7 @@ public function testIndex()
5656

5757
$this->loop->run();
5858
$resolvedMsg = Block\await($basePromise, $this->loop);
59-
$this->assertContains(
59+
$this->assertStringContainsString(
6060
"Message received: Hello World!",
6161
strval($resolvedMsg)
6262
);

appengine/flexible/wordpress/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function testIndex()
5151
// Access the blog top page
5252
$resp = $this->client->get('');
5353
$this->assertEquals('200', $resp->getStatusCode());
54-
$this->assertContains(
54+
$this->assertStringContainsString(
5555
'It looks like your WordPress installation is running on App '
5656
. 'Engine Flexible!',
5757
$resp->getBody()->getContents()

appengine/flexible/wordpress/test/wordpressTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function testSetup()
4545

4646
// check naively that variables were added
4747
$wpConfig = file_get_contents($dir . '/wordpress/wp-config.php');
48-
$this->assertContains($projectId, $wpConfig);
49-
$this->assertContains($dbPassword, $wpConfig);
48+
$this->assertStringContainsString($projectId, $wpConfig);
49+
$this->assertStringContainsString($dbPassword, $wpConfig);
5050
}
5151
}

appengine/php72/auth/test/DeployTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testIndex()
3838
$this->assertEquals('200', $resp->getStatusCode(),
3939
'top page status code');
4040
$contents = $resp->getBody()->getContents();
41-
$this->assertContains(
41+
$this->assertStringContainsString(
4242
sprintf('Bucket: %s', $projectId),
4343
$contents);
4444
$this->assertGreaterThanOrEqual(

appengine/php72/errorreporting/test/DeployTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class DeployTest extends TestCase
2929
use AppEngineDeploymentTrait;
3030
use EventuallyConsistentTestTrait;
3131

32-
public function setup()
32+
public function setUp(): void
3333
{
3434
$this->projectId = getenv('GOOGLE_PROJECT_ID');
3535
}
@@ -39,7 +39,7 @@ public function testIndex()
3939
// Access the modules app top page.
4040
$response = $this->client->get('');
4141
$this->assertEquals('200', $response->getStatusCode());
42-
$this->assertContains(
42+
$this->assertStringContainsString(
4343
'Click an error type',
4444
$response->getBody()->getContents()
4545
);
@@ -53,7 +53,7 @@ public function testExceptions()
5353
]);
5454

5555
$this->assertEquals('200', $response->getStatusCode());
56-
$this->assertContains(
56+
$this->assertStringContainsString(
5757
'Throwing a PHP Exception.',
5858
$response->getBody()->getContents()
5959
);
@@ -69,7 +69,7 @@ public function testUserErrors()
6969
]);
7070

7171
$this->assertEquals('200', $response->getStatusCode());
72-
$this->assertContains(
72+
$this->assertStringContainsString(
7373
'Triggering a PHP Error.',
7474
$response->getBody()->getContents()
7575
);
@@ -85,7 +85,7 @@ public function testFatalErrors()
8585
]);
8686

8787
$this->assertEquals('200', $response->getStatusCode());
88-
$this->assertContains(
88+
$this->assertStringContainsString(
8989
'Triggering a PHP Fatal Error by including a file with a syntax error.',
9090
$response->getBody()->getContents()
9191
);
@@ -119,7 +119,7 @@ private function verifyReportedError($message, $retryCount = 5)
119119
}
120120
}
121121

122-
$this->assertContains(
122+
$this->assertStringContainsString(
123123
$message,
124124
implode("\n", $messages)
125125
);

appengine/php72/front-controller/test/DeployTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,10 @@ public function testIndex()
3131
$this->assertEquals('200', $response->getStatusCode());
3232
}
3333

34-
/**
35-
* @expectedException GuzzleHttp\Exception\ClientException
36-
* @expectedExceptionMessage 404 Not Found
37-
*/
3834
public function testHomepagePhpIs404()
3935
{
36+
$this->expectException('GuzzleHttp\Exception\ClientException');
37+
$this->expectExceptionMessage('404 Not Found');
4038
// ensure homepage.php is a 404.
4139
$response = $this->client->get('/homepage.php');
4240
$this->assertEquals('404', $response->getStatusCode());

0 commit comments

Comments
 (0)