File: 004_fcgi_file_handles.t

package info (click to toggle)
libcgi-fast-perl 1%3A2.17-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 148 kB
  • sloc: perl: 243; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 691 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!perl

use strict;
use warnings;

use Test::More tests => 4;

use CGI::Fast;

# oook oook! monkey patching to mock FCGI behaviour
no warnings 'redefine';
no warnings 'once';
no warnings 'prototype';
*Accept = sub { 1 };
*FCGI::Request = sub {
	# check we actually pass file handles to FCGI::Request
    is( $_,'some file handle','file handle passed to FCGI' )
        foreach @_[0..2];
	return bless({});
};

CGI::Fast->file_handles({
	# really here you would use IO::Handle or some equivalent
	fcgi_input_file_handle  => 'some file handle',
	fcgi_output_file_handle => 'some file handle',
	fcgi_error_file_handle  => 'some file handle',
});

ok( my $q = CGI::Fast->new,'CGI::Fast->new' );