eZ\Publish\Core\MVC\Symfony\Security\Tests\User\IdentityTest::testGetHash PHP Method

testGetHash() public method

public testGetHash ( )
    public function testGetHash()
    {
        $identity = new Identity();
        $identity->setInformation('foo', 'bar');
        $hash1 = $identity->getHash();
        $this->assertInternalType('string', $hash1);
        $identity->setInformation('truc', 'muche');
        $hash2 = $identity->getHash();
        $this->assertInternalType('string', $hash2);
        $this->assertTrue($hash1 !== $hash2);
        $identity->setInformation('number', 123);
        $hash3 = $identity->getHash();
        $this->assertInternalType('string', $hash3);
        $this->assertTrue($hash3 !== $hash1);
        $this->assertTrue($hash3 !== $hash2);
        $identity->replaceInformation(array('foo' => 'bar'));
        $this->assertSame($hash1, $identity->getHash());
    }