1Test::Inline::Content::ULseegracCyo(n3t)ributed Perl DocTuemsetn:t:aItniloinne::Content::Legacy(3)
2
3
4
6 Test::Inline::Content::Legacy - Test::Inline 2 Content Handler for
7 legacy functions
8
10 version 2.214
11
13 Custom script content generation using Test::Inline 2.000+ with a
14 custom generator functions
15
16 my $header = "....";
17 my $function = sub {
18 my $Object = shift;
19 my $Script = shift;
20 return $header . $Script->merged_content;
21 };
22
23 my $Inline = Test::Inline->new(
24 ...
25 file_content => $function,
26 );
27
28 Migrating this same code to Test::Inline 2.100+ ContentHandler objects
29
30 my $header = "....";
31 my $function = sub {
32 my $Object = shift;
33 my $Script = shift;
34 return $header . $Script->merged_content;
35 };
36
37 my $ContentHandler = Test::Inline::Content::Legacy->new( $function );
38
39 my $Inline = Test::Inline->new(
40 ...
41 ContentHandler => $ContentHandler,
42 );
43
45 This class exists to provide a migration path for anyone using the
46 custom script generators in Test::Inline via the "file_content" param.
47
48 The synopsis above pretty much says all you need to know.
49
51 new $CODE_ref
52 The "new" constructor for "Test::Inline::Content::Legacy" takes a
53 single parameter of a "CODE" reference, as you would have previously
54 provided directly to "file_content".
55
56 Returns a new "Test::Inline::Content::Legacy" object, or "undef" if not
57 passed a "CODE" reference.
58
59 coderef
60 The "coderef" accessor returns the "CODE" reference for the object
61
62 process $Inline $Script
63 The "process" method works with the legacy function by passing the
64 Test::Inline and Test::Inline::Script arguments straight through to the
65 legacy function, and returning it's result as the return value.
66
68 See the main SUPPORT section.
69
70 Bugs may be submitted through the RT bug tracker
71 <https://rt.cpan.org/Public/Dist/Display.html?Name=Test-Inline> (or
72 bug-Test-Inline@rt.cpan.org <mailto:bug-Test-Inline@rt.cpan.org>).
73
75 Adam Kennedy <adamk@cpan.org>
76
78 This software is copyright (c) 2003 by Adam Kennedy.
79
80 This is free software; you can redistribute it and/or modify it under
81 the same terms as the Perl 5 programming language system itself.
82
83
84
85perl v5.32.1 2021-04-27 Test::Inline::Content::Legacy(3)