Pinq\Tests\Integration\Providers\DSL\ParameterHasherTest::testValueTypeHasher PHP Method

testValueTypeHasher() public method

public testValueTypeHasher ( )
    public function testValueTypeHasher()
    {
        $hasher = ParameterHasher::valueType();
        foreach ([1, 'erfse', 'DF$T$TWG$', 34343.34, null, true, false] as $value) {
            $this->assertSame($hasher->hash($value), $hasher->hash($value));
        }
        $this->assertNotSame($hasher->hash(3), $hasher->hash(5));
        $this->assertNotSame($hasher->hash('3'), $hasher->hash(3));
        $this->assertNotSame($hasher->hash(null), $hasher->hash(0));
        $this->assertNotSame($hasher->hash(null), $hasher->hash(false));
        $this->assertNotSame($hasher->hash(true), $hasher->hash(false));
        $this->assertNotSame($hasher->hash('abcdefg1'), $hasher->hash('abcdefg2'));
    }