use proper JSON encoding/decoding

This commit is contained in:
Graham Knop 2009-02-10 21:41:36 +00:00
parent 7023683b48
commit bf9bd2f0d2
18 changed files with 54 additions and 54 deletions

View file

@ -56,7 +56,7 @@ ok($session->id->valid($vid), 'a valid id was generated for the new collateral e
my $json;
$json = $product->get('variantsJSON');
my $jsonData = decode_json($json);
my $jsonData = JSON::from_json($json);
cmp_deeply(
$jsonData,
[ {a => 'aye', b => 'bee', vid => $vid } ],

View file

@ -107,7 +107,7 @@ isa_ok($matrixListing, 'WebGUI::Asset::MatrixListing');
$session->user({userId => 3});
my $json = $matrix->www_getCompareFormData('score');
my $compareFormData = JSON->new->utf8->decode($json);
my $compareFormData = JSON->new->decode($json);
cmp_deeply(
$compareFormData,

View file

@ -86,7 +86,7 @@ is($thingy->get('defaultThingId'),$thingId,"The Thingy assets defaultThingId was
$session->user({userId => 3});
my $json = $thingy->www_getThingViaAjax($thingId);
my $dataFromJSON = JSON->new->utf8->decode($json);
my $dataFromJSON = JSON->new->decode($json);
cmp_deeply(
$dataFromJSON,
@ -127,7 +127,7 @@ cmp_deeply(
# the newly created thing.
$json = $thingy->www_getThingsViaAjax();
$dataFromJSON = JSON->new->utf8->decode($json);
$dataFromJSON = JSON->new->decode($json);
cmp_deeply(
$dataFromJSON,
@ -220,7 +220,7 @@ cmp_deeply(
);
$json = $thingy->www_viewThingDataViaAjax($thingId,$newThingDataId);
$dataFromJSON = JSON->new->utf8->decode($json);
$dataFromJSON = JSON->new->decode($json);
cmp_deeply(
$dataFromJSON,
@ -268,7 +268,7 @@ $thingy->deleteThingData($thingId,$newThingDataId);
is($thingy->getViewThingVars($thingId,$newThingDataId),undef,'Thing data was succesfully deleted, getViewThingVars returns undef.');
$json = $thingy->www_viewThingDataViaAjax($thingId,$newThingDataId);
$dataFromJSON = JSON->new->utf8->decode($json);
$dataFromJSON = JSON->new->decode($json);
cmp_deeply(
$dataFromJSON,