view _test/Test/Web/Application.pm @ 190:cd1ff7029a63

IMLP::Web::View refactored, added new method 'require' which is available inside templates. Changed document rendering.
author cin
date Wed, 04 Apr 2012 17:51:27 +0400
parents d1676be8afcc
children 4d0e1962161c
line wrap: on
line source

package Test::Web::Application::Instance;
package Test::Web::Application;
use strict;
use parent qw(IMPL::Test::Unit);

use IMPL::Test qw(test failed);
require IMPL::Web::Application;

__PACKAGE__->PassThroughArgs;

sub CTOR {
	# simulate CGI environment
	
	$ENV{PATH_TRANSLATED} = "Resources/simple.tt";
}

test SpawnApp => sub {
	my $instance = spawn Test::Web::Application::Instance('Resources/app.xml');
	
	return 1;
};

test ActivateOnDemand => sub {
	my $instance = spawn Test::Web::Application::Instance('Resources/app.xml');
	
	my $ds = $instance->dataSource;
	
	return 1;
};

test SaveXml => sub {
	my $instance = spawn Test::Web::Application::Instance('Resources/app.xml');
	
	$instance->xml or failed "xml property is invalid";	
};

test Run => sub {
	my $instance = spawn Test::Web::Application::Instance('Resources/app.xml');
	$instance->Run();
};

package Test::Web::Application::Instance;
use parent qw(IMPL::Web::Application);

__PACKAGE__->PassThroughArgs;

use IMPL::Class::Property;

BEGIN {
	public property name => prop_all;
	public property options => prop_all;
	public property dataSource => prop_all;
	public property securityMod => prop_all;
}


1;