37 $this->passwordFactory->register(
$type, $config );
63 public function testHashing( $shouldMatch, $hash, $password ) {
64 $hash = $this->passwordFactory->newFromCiphertext( $hash );
65 $password = $this->passwordFactory->newFromPlaintext( $password, $hash );
66 $this->assertSame( $shouldMatch, $hash->equals( $password ) );
73 $hashObj = $this->passwordFactory->newFromCiphertext( $hash );
75 $unserialized = $this->passwordFactory->newFromCiphertext(
$serialized );
76 $this->assertTrue( $hashObj->equals( $unserialized ) );
85 $invalid = $this->passwordFactory->newFromCiphertext(
null );
86 $normal = $this->passwordFactory->newFromCiphertext( $hash );
88 $this->assertFalse( $invalid->equals( $normal ) );
89 $this->assertFalse( $normal->equals( $invalid ) );