src/Concerns/HasDocumentAssertions.php
public function assertError(array $error, bool $strict = true, string $message = ''): self
    {
        Assert::assertError($this, $error, $strict, $message);

        return $this;
    }
public function assertError(array $error, bool $strict = true, string $message = ''): self
    {
        Assert::assertError($this, $error, $strict, $message);

        return $this;
    }
Assert the document contains a single error that matches the supplied error.

@param array $error
@param bool $strict
@param string $message
@return $this