function it_is_a_password(Encoder $encoder) { $password = '******'; $encoder->hash($password)->willReturn(password_hash($password, PASSWORD_BCRYPT)); $this->beConstructedThroughCreate($password, $encoder); $this->shouldHaveType('Shrikeh\\Crypto\\Password'); }
public static function create($password, Encoder $encoder) { return new self($encoder->hash($password)); }