diff --git a/tests/framework/base/CSecurityManagerTest.php b/tests/framework/base/CSecurityManagerTest.php index a01355f90c..1f16287c14 100644 --- a/tests/framework/base/CSecurityManagerTest.php +++ b/tests/framework/base/CSecurityManagerTest.php @@ -164,7 +164,7 @@ public function testGenerateRandomString() // student-t test that the distribution of chars is uniform would be nice. for ($i=1; $i<999; $i+=1){ $ran=$sm->generateRandomString($i,false); - $this->assertInternalType('string', $ran); + $this->assertIsString($ran); $this->assertEquals(1, preg_match('{[a-zA-Z0-9_~]{' . $i . '}}', $ran)); } } @@ -176,7 +176,7 @@ public function testGenerateRandomBytes() $mbStrlen = function_exists('mb_strlen'); for ($i=1; $i<255; $i+=1){ $ran=$sm->generateRandomBytes($i,false); - $this->assertInternalType('string', $ran); + $this->assertIsString($ran); $this->assertEquals($i, $mbStrlen ? mb_strlen($ran, '8bit') : strlen($ran)); } } @@ -191,7 +191,7 @@ public function testGenerateRandomStringCS() // student-t test that the distribution of chars is uniform would be nice. for ($i=1; $i<999; $i+=1){ $ran=$sm->generateRandomString($i,true); - $this->assertInternalType('string', $ran); + $this->assertIsString($ran); $this->assertEquals(1, preg_match('{[a-zA-Z0-9_~]{' . $i . '}}', $ran)); } } @@ -206,7 +206,7 @@ public function testGenerateRandomBytesCS() $mbStrlen = function_exists('mb_strlen'); for ($i=1; $i<255; $i+=1){ $ran=$sm->generateRandomBytes($i,true); - $this->assertInternalType('string', $ran); + $this->assertIsString($ran); $this->assertEquals($i, $mbStrlen ? mb_strlen($ran, '8bit') : strlen($ran)); } } diff --git a/tests/framework/validators/CCompareValidatorTest.php b/tests/framework/validators/CCompareValidatorTest.php index 1bcbb889dd..fc146128f4 100644 --- a/tests/framework/validators/CCompareValidatorTest.php +++ b/tests/framework/validators/CCompareValidatorTest.php @@ -35,7 +35,7 @@ public function testValidationErrorsWithEquals() $validator->operator = '='; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be repeated exactly.', $script); } @@ -65,7 +65,7 @@ public function testValidationErrorsWithNotEquals() $validator->operator = '!='; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must not be equal to \"{compareValue}\".".replace(\'{compareValue}\', ', $script); $validator->message = '{compareAttribute}'; @@ -99,7 +99,7 @@ public function testValidationErrorsWitGreaterThan() $validator->operator = '>'; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be greater than \"{compareValue}\".".replace(\'{compareValue}\', ', $script); $validator->message = '{compareAttribute}'; @@ -133,7 +133,7 @@ public function testValidationErrorsWitGreaterThanOrEqual() $validator->operator = '>='; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be greater than or equal to \"{compareValue}\".".replace(\'{compareValue}\', ', $script); $validator->message = '{compareAttribute}'; @@ -167,7 +167,7 @@ public function testValidationErrorsWitLessThan() $validator->operator = '<'; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be less than \"{compareValue}\".".replace(\'{compareValue}\', ', $script); $validator->message = '{compareAttribute}'; @@ -201,7 +201,7 @@ public function testValidationErrorsWitLessThanOrEqual() $validator->operator = '<='; $validator->compareAttribute = 'bar'; $script = $validator->clientValidateAttribute($model, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be less than or equal to \"{compareValue}\".".replace(\'{compareValue}\', ', $script); $validator->message = '{compareAttribute}'; @@ -262,7 +262,7 @@ public function testOverrideCompareValue() $validator->operator = '='; $validator->compareValue = 'bar'; $script = $validator->clientValidateAttribute($stub, 'foo'); - $this->assertInternalType('string', $script); + $this->assertIsString($script); $this->assertContains('Foo must be repeated exactly', $script); } diff --git a/tests/framework/validators/CDateValidatorTest.php b/tests/framework/validators/CDateValidatorTest.php index 653b80ca79..e7a3c69f5c 100644 --- a/tests/framework/validators/CDateValidatorTest.php +++ b/tests/framework/validators/CDateValidatorTest.php @@ -60,7 +60,7 @@ public function testTimestampOption() $model = $this->getModelMock(['timestampAttribute' => 'bar']); $model->foo = '01/01/2011'; $this->assertTrue($model->validate()); - $this->assertInternalType('integer', $model->bar); + $this->assertIsInteger($model->bar); $this->assertEquals(strtotime('1 Jan 2011'), $model->bar); } diff --git a/tests/framework/web/CHttpSessionTest.php b/tests/framework/web/CHttpSessionTest.php index 66de27b7f4..c2158ec3a0 100644 --- a/tests/framework/web/CHttpSessionTest.php +++ b/tests/framework/web/CHttpSessionTest.php @@ -5,7 +5,7 @@ class CHttpSessionTest extends CTestCase { protected function checkProb($gcProb) { Yii::app()->session->gCProbability = $gcProb; $value = Yii::app()->session->gCProbability; - $this->assertInternalType('float', $value); + $this->assertIsFloat($value); $this->assertLessThanOrEqual(1, $value); $this->assertGreaterThanOrEqual(0, $value); $this->assertLessThanOrEqual(1 / 21474836.47, abs($gcProb - $value));