Merge pull request #9843 from cakephp/php71

Add PHP7.1 to test matrix.
This commit is contained in:
Mark Story 2016-12-07 21:40:54 -05:00 committed by GitHub
commit 420336f536
8 changed files with 24 additions and 14 deletions

View file

@ -6,6 +6,7 @@ php:
- 5.5
- 5.6
- 7.0
- 7.1
env:
- DB=mysql
@ -22,7 +23,7 @@ matrix:
- php: 5.4
env: DB=sqlite
- php: 5.4
- php: 7.0
env: PHPCS=1

View file

@ -48,14 +48,15 @@ class ControllerAuthorizeTest extends CakeTestCase {
* testControllerTypeError
*
* @expectedException PHPUnit_Framework_Error
* @throws PHPUnit_Framework_Error
* @return void
* @throws PHPUnit_Framework_Error
*/
public function testControllerTypeError() {
try {
$this->auth->controller(new StdClass());
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
$this->fail('No exception thrown');
} catch (TypeError $e) {
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
}
}

View file

@ -238,6 +238,7 @@ class CookieComponentTest extends CakeTestCase {
* @return void
*/
public function testWriteWithFalseyValue() {
$this->skipIf(!extension_loaded('mcrypt'), 'No Mcrypt, skipping.');
$this->Cookie->type('aes');
$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#HKis~#^';

View file

@ -450,16 +450,16 @@ class ConfigureTest extends CakeTestCase {
* test reader() throwing exceptions on missing interface.
*
* @expectedException PHPUnit_Framework_Error
* @throws PHPUnit_Framework_Error
* @return void
* @throws PHPUnit_Framework_Error
*/
public function testReaderExceptionOnIncorrectClass() {
$reader = new StdClass();
try {
Configure::config('test', $reader);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
} catch (TypeError $e) {
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
}
}

View file

@ -2909,14 +2909,15 @@ SQL;
* testDropSchemaNoSchema method
*
* @expectedException PHPUnit_Framework_Error
* @throws PHPUnit_Framework_Error
* @return void
* @throws PHPUnit_Framework_Error
*/
public function testDropSchemaNoSchema() {
try {
$this->Dbo->dropSchema(null);
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
$this->fail('No exception');
} catch (TypeError $e) {
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
}
}

View file

@ -2224,14 +2224,15 @@ class ModelValidationTest extends BaseModelTest {
* Test that type hint exception is thrown
*
* @expectedException PHPUnit_Framework_Error
* @throws PHPUnit_Framework_Error
* @return void
* @throws PHPUnit_Framework_Error
*/
public function testValidatorTypehintException() {
try {
new ModelValidator('asdasds');
} catch (Throwable $t) {
throw new PHPUnit_Framework_Error($t);
$this->fail('No exeption raised');
} catch (TypeError $e) {
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
}
}

View file

@ -328,6 +328,7 @@ class SecurityTest extends CakeTestCase {
* @return void
*/
public function testEncryptDecrypt() {
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
$txt = 'The quick brown fox';
$key = 'This key is longer than 32 bytes long.';
$result = Security::encrypt($txt, $key);
@ -342,6 +343,7 @@ class SecurityTest extends CakeTestCase {
* @return void
*/
public function testDecryptKeyFailure() {
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
$txt = 'The quick brown fox';
$key = 'This key is longer than 32 bytes long.';
Security::encrypt($txt, $key);
@ -356,6 +358,7 @@ class SecurityTest extends CakeTestCase {
* @return void
*/
public function testDecryptHmacFailure() {
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
$txt = 'The quick brown fox';
$key = 'This key is quite long and works well.';
$salt = 'this is a delicious salt!';
@ -372,6 +375,7 @@ class SecurityTest extends CakeTestCase {
* @return void
*/
public function testDecryptHmacSaltFailure() {
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
$txt = 'The quick brown fox';
$key = 'This key is quite long and works well.';
$salt = 'this is a delicious salt!';
@ -400,6 +404,7 @@ class SecurityTest extends CakeTestCase {
* @return void
*/
public function testEncryptDecryptFalseyData() {
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
$key = 'This is a key that is long enough to be ok.';
$result = Security::encrypt('', $key);

View file

@ -564,7 +564,7 @@ class View extends CakeObject {
$type = $response->mapType($response->type());
if (Configure::read('debug') > 0 && $type === 'html') {
echo "<!-- Cached Render Time: " . round(microtime(true) - $timeStart, 4) . "s -->";
echo "<!-- Cached Render Time: " . round(microtime(true) - (int)$timeStart, 4) . "s -->";
}
$out = ob_get_clean();