function it_throws_when_invalid_alias_is_generated(Validator $validator)
 {
     $model = (object) ['id' => 5];
     $validator->validate(Argument::cetera())->willReturn(false);
     $this->beConstructedWith([], $validator, static::TABLE_NAME);
     $this->shouldThrow('Netzmacht\\Contao\\Toolkit\\Data\\Alias\\Exception\\InvalidAliasException')->during('generate', [$model, static::ALIAS_VALUE]);
 }
 /**
  * Consider if value is an valid alias.
  *
  * @param Database|Model $result Data record.
  * @param mixed          $value  The alias value.
  * @param int            $rowId  The row id.
  *
  * @return bool
  */
 private function isValid($result, $value, $rowId)
 {
     return $this->validator->validate($result, $value, [$rowId]);
 }