diff --git a/eZ/Publish/Core/FieldType/Tests/EmailAddressTest.php b/eZ/Publish/Core/FieldType/Tests/EmailAddressTest.php index 1c691ae8dbb..002c848fd3f 100644 --- a/eZ/Publish/Core/FieldType/Tests/EmailAddressTest.php +++ b/eZ/Publish/Core/FieldType/Tests/EmailAddressTest.php @@ -204,7 +204,7 @@ public function provideInputForToHash() return array( array( new EmailAddressValue(), - '', + null, ), array( new EmailAddressValue('spam_mail@ex-something.no'), diff --git a/eZ/Publish/Core/FieldType/Tests/FieldTypeTest.php b/eZ/Publish/Core/FieldType/Tests/FieldTypeTest.php index 90b148b51d5..4a3a07e07af 100644 --- a/eZ/Publish/Core/FieldType/Tests/FieldTypeTest.php +++ b/eZ/Publish/Core/FieldType/Tests/FieldTypeTest.php @@ -663,11 +663,19 @@ public function testToHash($inputValue, $expectedResult) $this->assertIsValidHashValue($actualResult); - $this->assertEquals( - $expectedResult, - $actualResult, - 'toHash() method did not create expected result.' - ); + if (is_object($expectedResult) || is_array($expectedResult)) { + $this->assertEquals( + $expectedResult, + $actualResult, + 'toHash() method did not create expected result.' + ); + } else { + $this->assertSame( + $expectedResult, + $actualResult, + 'toHash() method did not create expected result.' + ); + } } /** @@ -684,11 +692,19 @@ public function testFromHash($inputHash, $expectedResult) $actualResult = $fieldType->fromHash($inputHash); - $this->assertEquals( - $expectedResult, - $actualResult, - 'fromHash() method did not create expected result.' - ); + if (is_object($expectedResult) || is_array($expectedResult)) { + $this->assertEquals( + $expectedResult, + $actualResult, + 'fromHash() method did not create expected result.' + ); + } else { + $this->assertSame( + $expectedResult, + $actualResult, + 'fromHash() method did not create expected result.' + ); + } } public function testEmptyValueIsEmpty() diff --git a/eZ/Publish/Core/FieldType/Tests/TextBlockTest.php b/eZ/Publish/Core/FieldType/Tests/TextBlockTest.php index cdfcc898d6d..f0d2dd96070 100644 --- a/eZ/Publish/Core/FieldType/Tests/TextBlockTest.php +++ b/eZ/Publish/Core/FieldType/Tests/TextBlockTest.php @@ -207,7 +207,7 @@ public function provideInputForToHash() return array( array( new TextBlockValue(), - '', + null, ), array( new TextBlockValue('sindelfingen'), diff --git a/eZ/Publish/Core/FieldType/Tests/TextLineTest.php b/eZ/Publish/Core/FieldType/Tests/TextLineTest.php index b0259e13bd8..f91ba40971a 100644 --- a/eZ/Publish/Core/FieldType/Tests/TextLineTest.php +++ b/eZ/Publish/Core/FieldType/Tests/TextLineTest.php @@ -230,8 +230,8 @@ public function provideInputForToHash() null, ), array( - new TextLineValue(), - '', + new TextLineValue(''), + null, ), array( new TextLineValue('sindelfingen'), diff --git a/eZ/Publish/Core/FieldType/Tests/TimeTest.php b/eZ/Publish/Core/FieldType/Tests/TimeTest.php index 9390fdb2a80..b3878780efd 100644 --- a/eZ/Publish/Core/FieldType/Tests/TimeTest.php +++ b/eZ/Publish/Core/FieldType/Tests/TimeTest.php @@ -381,66 +381,4 @@ public function provideDataForGetName() array(new TimeValue(200), '12:03:20 am'), ); } - - /** - * @param mixed $inputValue - * @param array $expectedResult - * - * This overrides the FieldTypeTest method until it gets updated and all field types fixed in EZP-25424 - * - * @dataProvider provideInputForToHash - */ - public function testToHash($inputValue, $expectedResult) - { - $fieldType = $this->getFieldTypeUnderTest(); - - $actualResult = $fieldType->toHash($inputValue); - - $this->assertIsValidHashValue($actualResult); - - if (is_object($expectedResult) || is_array($expectedResult)) { - $this->assertEquals( - $expectedResult, - $actualResult, - 'toHash() method did not create expected result.' - ); - } else { - $this->assertSame( - $expectedResult, - $actualResult, - 'toHash() method did not create expected result.' - ); - } - } - - /** - * @param mixed $inputValue - * @param array $expectedResult - * - * This overrides the FieldTypeTest method until it gets updated and all field types fixed in EZP-25424 - * - * @dataProvider provideInputForFromHash - */ - public function testFromHash($inputHash, $expectedResult) - { - $this->assertIsValidHashValue($inputHash); - - $fieldType = $this->getFieldTypeUnderTest(); - - $actualResult = $fieldType->fromHash($inputHash); - - if (is_object($expectedResult) || is_array($expectedResult)) { - $this->assertEquals( - $expectedResult, - $actualResult, - 'fromHash() method did not create expected result.' - ); - } else { - $this->assertSame( - $expectedResult, - $actualResult, - 'fromHash() method did not create expected result.' - ); - } - } }