mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-19 02:56:15 +00:00
commit
420336f536
8 changed files with 24 additions and 14 deletions
|
@ -6,6 +6,7 @@ php:
|
||||||
- 5.5
|
- 5.5
|
||||||
- 5.6
|
- 5.6
|
||||||
- 7.0
|
- 7.0
|
||||||
|
- 7.1
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- DB=mysql
|
- DB=mysql
|
||||||
|
@ -22,7 +23,7 @@ matrix:
|
||||||
- php: 5.4
|
- php: 5.4
|
||||||
env: DB=sqlite
|
env: DB=sqlite
|
||||||
|
|
||||||
- php: 5.4
|
- php: 7.0
|
||||||
env: PHPCS=1
|
env: PHPCS=1
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -48,14 +48,15 @@ class ControllerAuthorizeTest extends CakeTestCase {
|
||||||
* testControllerTypeError
|
* testControllerTypeError
|
||||||
*
|
*
|
||||||
* @expectedException PHPUnit_Framework_Error
|
* @expectedException PHPUnit_Framework_Error
|
||||||
* @throws PHPUnit_Framework_Error
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws PHPUnit_Framework_Error
|
||||||
*/
|
*/
|
||||||
public function testControllerTypeError() {
|
public function testControllerTypeError() {
|
||||||
try {
|
try {
|
||||||
$this->auth->controller(new StdClass());
|
$this->auth->controller(new StdClass());
|
||||||
} catch (Throwable $t) {
|
$this->fail('No exception thrown');
|
||||||
throw new PHPUnit_Framework_Error($t);
|
} catch (TypeError $e) {
|
||||||
|
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -238,6 +238,7 @@ class CookieComponentTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testWriteWithFalseyValue() {
|
public function testWriteWithFalseyValue() {
|
||||||
|
$this->skipIf(!extension_loaded('mcrypt'), 'No Mcrypt, skipping.');
|
||||||
$this->Cookie->type('aes');
|
$this->Cookie->type('aes');
|
||||||
$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#HKis~#^';
|
$this->Cookie->key = 'qSI232qs*&sXOw!adre@34SAv!@*(XSL#$%)asGb$@11~_+!@#HKis~#^';
|
||||||
|
|
||||||
|
|
|
@ -450,16 +450,16 @@ class ConfigureTest extends CakeTestCase {
|
||||||
* test reader() throwing exceptions on missing interface.
|
* test reader() throwing exceptions on missing interface.
|
||||||
*
|
*
|
||||||
* @expectedException PHPUnit_Framework_Error
|
* @expectedException PHPUnit_Framework_Error
|
||||||
* @throws PHPUnit_Framework_Error
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws PHPUnit_Framework_Error
|
||||||
*/
|
*/
|
||||||
public function testReaderExceptionOnIncorrectClass() {
|
public function testReaderExceptionOnIncorrectClass() {
|
||||||
$reader = new StdClass();
|
$reader = new StdClass();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Configure::config('test', $reader);
|
Configure::config('test', $reader);
|
||||||
} catch (Throwable $t) {
|
} catch (TypeError $e) {
|
||||||
throw new PHPUnit_Framework_Error($t);
|
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2909,14 +2909,15 @@ SQL;
|
||||||
* testDropSchemaNoSchema method
|
* testDropSchemaNoSchema method
|
||||||
*
|
*
|
||||||
* @expectedException PHPUnit_Framework_Error
|
* @expectedException PHPUnit_Framework_Error
|
||||||
* @throws PHPUnit_Framework_Error
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws PHPUnit_Framework_Error
|
||||||
*/
|
*/
|
||||||
public function testDropSchemaNoSchema() {
|
public function testDropSchemaNoSchema() {
|
||||||
try {
|
try {
|
||||||
$this->Dbo->dropSchema(null);
|
$this->Dbo->dropSchema(null);
|
||||||
} catch (Throwable $t) {
|
$this->fail('No exception');
|
||||||
throw new PHPUnit_Framework_Error($t);
|
} catch (TypeError $e) {
|
||||||
|
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2224,14 +2224,15 @@ class ModelValidationTest extends BaseModelTest {
|
||||||
* Test that type hint exception is thrown
|
* Test that type hint exception is thrown
|
||||||
*
|
*
|
||||||
* @expectedException PHPUnit_Framework_Error
|
* @expectedException PHPUnit_Framework_Error
|
||||||
* @throws PHPUnit_Framework_Error
|
|
||||||
* @return void
|
* @return void
|
||||||
|
* @throws PHPUnit_Framework_Error
|
||||||
*/
|
*/
|
||||||
public function testValidatorTypehintException() {
|
public function testValidatorTypehintException() {
|
||||||
try {
|
try {
|
||||||
new ModelValidator('asdasds');
|
new ModelValidator('asdasds');
|
||||||
} catch (Throwable $t) {
|
$this->fail('No exeption raised');
|
||||||
throw new PHPUnit_Framework_Error($t);
|
} catch (TypeError $e) {
|
||||||
|
throw new PHPUnit_Framework_Error('Raised an error', 100, __FILE__, __LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -328,6 +328,7 @@ class SecurityTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testEncryptDecrypt() {
|
public function testEncryptDecrypt() {
|
||||||
|
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
|
||||||
$txt = 'The quick brown fox';
|
$txt = 'The quick brown fox';
|
||||||
$key = 'This key is longer than 32 bytes long.';
|
$key = 'This key is longer than 32 bytes long.';
|
||||||
$result = Security::encrypt($txt, $key);
|
$result = Security::encrypt($txt, $key);
|
||||||
|
@ -342,6 +343,7 @@ class SecurityTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDecryptKeyFailure() {
|
public function testDecryptKeyFailure() {
|
||||||
|
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
|
||||||
$txt = 'The quick brown fox';
|
$txt = 'The quick brown fox';
|
||||||
$key = 'This key is longer than 32 bytes long.';
|
$key = 'This key is longer than 32 bytes long.';
|
||||||
Security::encrypt($txt, $key);
|
Security::encrypt($txt, $key);
|
||||||
|
@ -356,6 +358,7 @@ class SecurityTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDecryptHmacFailure() {
|
public function testDecryptHmacFailure() {
|
||||||
|
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
|
||||||
$txt = 'The quick brown fox';
|
$txt = 'The quick brown fox';
|
||||||
$key = 'This key is quite long and works well.';
|
$key = 'This key is quite long and works well.';
|
||||||
$salt = 'this is a delicious salt!';
|
$salt = 'this is a delicious salt!';
|
||||||
|
@ -372,6 +375,7 @@ class SecurityTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testDecryptHmacSaltFailure() {
|
public function testDecryptHmacSaltFailure() {
|
||||||
|
$this->skipIf(!extension_loaded('mcrypt'), 'This test requires mcrypt to be installed');
|
||||||
$txt = 'The quick brown fox';
|
$txt = 'The quick brown fox';
|
||||||
$key = 'This key is quite long and works well.';
|
$key = 'This key is quite long and works well.';
|
||||||
$salt = 'this is a delicious salt!';
|
$salt = 'this is a delicious salt!';
|
||||||
|
@ -400,6 +404,7 @@ class SecurityTest extends CakeTestCase {
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function testEncryptDecryptFalseyData() {
|
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.';
|
$key = 'This is a key that is long enough to be ok.';
|
||||||
|
|
||||||
$result = Security::encrypt('', $key);
|
$result = Security::encrypt('', $key);
|
||||||
|
|
|
@ -564,7 +564,7 @@ class View extends CakeObject {
|
||||||
|
|
||||||
$type = $response->mapType($response->type());
|
$type = $response->mapType($response->type());
|
||||||
if (Configure::read('debug') > 0 && $type === 'html') {
|
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();
|
$out = ob_get_clean();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue