root/lang/perl/Atomik/trunk/t/21_entry_crud.t @ 16930

Revision 16930, 1.1 kB (checked in by daisuke, 6 years ago)

change return value for entry_create()

Line 
1use strict;
2use lib("t/lib");
3use Test::More;
4use Test::Atomik
5    tests => 8,
6    network => 1,
7    env_default => {
8        ENTRY_COLLECTION_URL => "http://bitworking.org/projects/apptestsite/app.cgi/service/entry/"
9    },
10    env_require => [
11        qw( ENTRY_COLLECTION_URL )
12    ]
13;
14
15BEGIN
16{
17    use_ok("Atomik::Client");
18}
19
20{
21    my $client = Atomik::Client->new();
22    my ($entry_uri, $entry) = $client->entry_create(
23        uri   => $ENV{ ENTRY_COLLECTION_URL },
24        entry => \<<EOXML,
25<?xml version="1.0"?>
26<entry xmlns="http://www.w3.org/2005/Atom">
27  <title>Atom-Powered Robots Run Amok</title>
28  <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
29  <updated>2003-12-13T18:30:02Z</updated>
30  <author><name>John Doe</name></author>
31  <content>Some text.</content>
32</entry>
33EOXML
34    );
35
36    ok($entry_uri);
37    ok($entry);
38    isa_ok($entry, "Atomik::Entry");
39
40    my ($edit) = grep { ($_->rel || '') eq 'edit' } $entry->link;
41    ok( $edit );
42    is( $edit->href => '.' );
43
44    my $got_entry = $client->entry_get( uri => $entry_uri );
45
46    ok( $got_entry, "Accessed entry $entry_uri" );
47    isa_ok( $got_entry, 'Atomik::Entry' );
48}
49
Note: See TracBrowser for help on using the browser.