eZ\Publish\Core\FieldType\Tests\TimeTest::testToHash PHP Method

testToHash() public method

public testToHash ( mixed $inputValue, array $expectedResult )
$inputValue mixed
$expectedResult array This overrides the FieldTypeTest method until it gets updated and all field types fixed in EZP-25424
    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.');
        }
    }