From c920bee629e885ed0db2411b0838660f597a503b Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Wed, 20 Feb 2008 16:40:50 +0000 Subject: [PATCH] add an explicit test for the safe copying of Asset properties inside get --- t/Asset/Asset.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/t/Asset/Asset.t b/t/Asset/Asset.t index 6f07b26b7..c26cc38f8 100644 --- a/t/Asset/Asset.t +++ b/t/Asset/Asset.t @@ -144,7 +144,7 @@ $canViewMaker->prepare( }, ); -plan tests => 88 +plan tests => 89 + scalar(@fixIdTests) + scalar(@fixTitleTests) + 2*scalar(@getTitleTests) #same tests used for getTitle and getMenuTitle @@ -688,6 +688,19 @@ $session->setting->set('notFoundPage', $origNotFoundPage); ################################################################ is($rootAsset->get('isExportable'), 1, 'isExportable exists, defaults to 1'); +################################################################ +# +# get +# +################################################################ +my $assetProps = $rootAsset->get(); +my $funkyTitle = q{Miss Annie's Whoopie Emporium and Sasparilla Shop}; +diag $assetProps->{title}; +$assetProps->{title} = $funkyTitle; +diag $assetProps->{title}; + +isnt( $rootAsset->get('title'), $funkyTitle, 'get returns a safe copy of the Asset properties'); + END: { $session->config->set( 'extrasURL', $origExtras); $session->config->set( 'uploadsURL', $origUploads);