---
name: "Apache::TestHandler"
section: "3pm"
platform: "linux"
package: "libapache2-mod-perl2"
version: "2.0.13-2+b2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Apache::TestHandler"
---

# Apache::TestHandler(3pm)

a few response handlers and helpers

## NAME

Apache::TestHandler - a few response handlers and helpers

## SYNOPSIS

```
    package My::Test;
    use Apache::TestHandler ();
    sub handler {
        my ($r) = @_;
        my $result = do_my_test;
        Apache::TestHandler::ok1 $r, $result;
    }
    sub handler2 {
        my ($r) = @_;
        my $result = do_my_test;
        Apache::TestHandler::ok $r, $result;
    }
```

## DESCRIPTION

`"Apache::TestHandler"` provides 2 very simple response handler.

## FUNCTIONS

- ok $r, $boolean

  The handler simply prints out `"ok"` or `"not ok"` depending on the optional `$boolean` parameter.

  If `$boolean` is omitted `"true"` is assumed.

- ok1 $r, $boolean

  This handler implements a simple response-only test. It can be used on its own to check if for a certain URI the response phase is reached. Or it can be called like a normal function to print out the test result. The client side is automatically created as described in \<http://perl.apache.org/docs/general/testing/testing.html#Developing\_Response\_only\_Part\_of\_a\_Test\>.

  `$boolean` is optional. If omitted `"true"` is assumed.

- same\_interp\_counter

  - same\_interp\_fixup

  TODO

## SEE ALSO

The Apache-Test tutorial: \<http://perl.apache.org/docs/general/testing/testing.html\>.

Apache::Test.

## AUTHOR

Doug MacEachern, Geoffrey Young, Stas Bekman, Torsten Förtsch and others.

Questions can be asked at the test-dev \<at\> httpd.apache.org list For more information see: http://httpd.apache.org/test/.
