Skip to content
This repository has been archived by the owner on Oct 11, 2021. It is now read-only.

Commit

Permalink
See that Order works even a little
Browse files Browse the repository at this point in the history
  • Loading branch information
markpasc committed Dec 5, 2011
1 parent d449f34 commit 2a7577d
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions plugins/Order/t/11-basic.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
use lib qw( lib extlib plugins/Order/lib );

use strict;
use warnings;

use MT;
use MT::Template::Context;
use MT::Builder;
use MT::App;

use Test::More tests => 2;

use Order::Plugin;

my $cms = MT::App->new;


sub build {
my ($template, $data) = @_;
my $ctx = MT::Template::Context->new;
my $b = MT::Builder->new;
my $tokens = $b->compile($ctx, $template);

$ctx->{__stash} = $data;
my $ret = $b->build($ctx, $tokens);
die $b->errstr if !defined $ret;

return $ret;
}


is(build(q{<mt:Ignore>derp</mt:Ignore>}), q{}, "templates will build");

my $t = <<EOF;
<mt:Order>
<mt:OrderItem>
<mt:setvarblock name="order_by">1</mt:setvarblock>
hello
</mt:OrderItem>
</mt:Order>
EOF
like(build($t), qr{ \A \s* hello \s* \z }xms, "Order works at all (one item)");

1;

0 comments on commit 2a7577d

Please sign in to comment.