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

Revision 17349, 1.2 kB (checked in by daisuke, 5 years ago)

remove references to LibXML

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