Created
March 4, 2014 14:30
-
-
Save willert/9347476 to your computer and use it in GitHub Desktop.
Test case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Util::Certificates; | |
use WeCARE::Test -app => 'AMG'; | |
use utf8; | |
use AMG::Certificate; | |
sub test_cert { | |
my $self = shift; | |
my $template = $self->env->path_to( 'share', 'member_cert.pdf' ); | |
my $boilerplate = $template->slurp( iomode => '<:raw' ); | |
my $pdf = AMG::Certificate->new({ | |
content => $boilerplate, | |
teilnehmername => 'Herr Herbert Müller', | |
}); | |
$pdf->finalize_content; | |
my $tmp_dir = $self->env->path_to( 't', 'tmp' ); | |
$tmp_dir->mkpath; | |
my $cert_file = $tmp_dir->file('cert.pdf'); | |
$cert_file->spew( iomode => '>:raw', $pdf->content ); | |
ok -f $cert_file->stringify, "Created pdf $cert_file"; | |
system 'xdg-open' => $cert_file; | |
} | |
1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment