First work with BUILDARGS. Set defaults for the title,menuTitle. Some tests in t/Asset.t
From this point forward, WebGUI::Asset->new($session, $assetId) will only return the Root node, and not any other classes.
This commit is contained in:
parent
5574cdf9b0
commit
0fd922daed
2 changed files with 91 additions and 80 deletions
37
t/Asset.t
Normal file
37
t/Asset.t
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#-------------------------------------------------------------------
|
||||
# WebGUI is Copyright 2001-2009 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 warnings;
|
||||
no warnings qw(uninitialized);
|
||||
use lib "$FindBin::Bin/lib";
|
||||
|
||||
use WebGUI::Test;
|
||||
|
||||
use Test::More;
|
||||
use Test::Deep;
|
||||
use Test::Exception;
|
||||
|
||||
plan tests => 5;
|
||||
|
||||
my $session = WebGUI::Test->session;
|
||||
|
||||
my $asset;
|
||||
|
||||
$asset = WebGUI::Asset->new({session => $session, });
|
||||
|
||||
isa_ok $asset, 'WebGUI::Asset';
|
||||
isa_ok $asset->session, 'WebGUI::Session';
|
||||
is $asset->session->getId, $session->getId, 'asset was assigned the correct session';
|
||||
|
||||
can_ok $asset, 'title', 'menuTitle';
|
||||
is $asset->title, 'Untitled', 'title: default is untitled';
|
||||
is $asset->title, 'Untitled', 'menuTitle: default is untitled';
|
||||
Loading…
Add table
Add a link
Reference in a new issue