Skip to content

Commit

Permalink
Add php 7.2 version check (GoogleCloudPlatform#413)
Browse files Browse the repository at this point in the history
* Add php 7.2 version check

* Fix pattern in PHP 7.2 version test

* Temporarily serialize integration tests to isolate test failure

* Revert "Temporarily serialize integration tests to isolate test failure"

This reverts commit 09071b5.

* Add explicit .gcloudignore file so the php-test.yaml builder file will be used in tests
  • Loading branch information
chingor13 authored Feb 5, 2018
1 parent 89f3717 commit cfdd973
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gcloudignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**/vendor
.php_cs.cache
deb-package-builder/pkg/
21 changes: 20 additions & 1 deletion check-versions/tests/VersionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,15 @@ public static function setUpBeforeClass()
self::$versions['php71'] = $matches[1];
} else {
self::$versions['php71'] =
'Failed to detect the latest PHP70 version';
'Failed to detect the latest PHP71 version';
}

$pattern = '/PHP (7\.2\.\d+)/';
if (preg_match($pattern, $body, $matches)) {
self::$versions['php72'] = $matches[1];
} else {
self::$versions['php72'] =
'Failed to detect the latest PHP72 version';
}

exec('apt-get update');
Expand Down Expand Up @@ -88,4 +96,15 @@ public function testPHP71Version()
$this->fail('Failed to detect the current php71 version');
}
}

public function testPHP72Version()
{
$output = exec('apt-cache madison gcp-php72');
$pattern = '/(7\.2\.\d+)/';
if (preg_match($pattern, $output, $matches)) {
$this->assertEquals($matches[1], self::$versions['php72']);
} else {
$this->fail('Failed to detect the current php72 version');
}
}
}

0 comments on commit cfdd973

Please sign in to comment.