---
name: "Catmandu::Validator::Mock"
section: "3pm"
platform: "linux"
package: "libcatmandu-perl"
version: "1.2024-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Catmandu::Validator::Mock"
---

# Catmandu::Validator::Mock(3pm)

Validate items based on a flag

## NAME

Catmandu::Validator::Mock - Validate items based on a flag

## SYNOPSIS

```
    use Catmandu::Validator::Mock;
    my $validator = Catmandu::Validator::Mock->new(
        message  => 'item is invalid',
        reject   => 1,
    );
```

## DESCRIPTION

This Catmandu::Validator can be used for testing as it does not actually look at the data to validate. Instead it rejects items if `"reject"` is set to a true value.

## CONFIGURATION

- message

  Error message to return for rejected items.

- reject

  The validator marks all items as invalid as long as this flag is true. Default is false.

## SEE ALSO

See Catmandu::Validator for inherited methods, common configuration options, and usage.
