From 2df0c6174c7f477adbccfd2ff40f613588a0d069 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Tue, 4 Jul 2006 21:52:55 +0000 Subject: [PATCH] simple test of PageTitle macro --- t/Macro/PageTitle.t | 48 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 t/Macro/PageTitle.t diff --git a/t/Macro/PageTitle.t b/t/Macro/PageTitle.t new file mode 100644 index 000000000..c6235af74 --- /dev/null +++ b/t/Macro/PageTitle.t @@ -0,0 +1,48 @@ +#------------------------------------------------------------------- +# WebGUI is Copyright 2001-2006 Plain Black Corporation. +#------------------------------------------------------------------- +# Please read the legal notices (docs/legal.txt) and the license +# (docs/license.txt) that came with this distribution before using +# this software. +#------------------------------------------------------------------- +# http://www.plainblack.com info@plainblack.com +#------------------------------------------------------------------- + +use FindBin; +use strict; +use lib "$FindBin::Bin/../lib"; + +use WebGUI::Test; +use WebGUI::Macro; +use WebGUI::Session; +use WebGUI::Macro_Config; +use Data::Dumper; + +use Test::More; # increment this value for each test you create + +my $session = WebGUI::Test->session; + +unless ($session->config->get('macros')->{'PageTitle'}) { + Macro_Config::insert_macro($session, 'PageTitle', 'PageTitle'); +} + + +my $macroText = '^PageTitle;'; +my $output; + +plan tests => 2; + +$output = $macroText; + +my $homeAsset = WebGUI::Asset->getDefault($session); + +##Make the homeAsset the default asset in the session. +$session->asset($homeAsset); + +WebGUI::Macro::process($session, \$output); +is($output, $homeAsset->get('title'), 'fetching title for site default asset'); + +TODO: { + local $TODO = "Tests to make later"; + ok(0, 'Fetch title from locally made asset with known title'); +}