mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-18 18:46:17 +00:00
commit
420336f536
8 changed files with 24 additions and 14 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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~#^';
|
||||
|
||||
|
|
|
@ -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__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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__);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue