Get the status actually active at buddy signon instead of hardcoding AVAILABLE.
[thrasher.git] / perl / tests / entity_capabilities.pl
blobb08ae672fc65a82939f6d39c870bba5fdaa4b3cc
1 #!/usr/bin/perl
3 use strict;
4 use warnings;
6 # Test that the entity capabilities plugin works as expected.
8 use Test::More 'no_plan';
9 use Data::Dumper;
11 BEGIN {
12 use_ok 'Thrasher::Test', qw(:all);
13 use_ok 'Thrasher', qw(:all);
14 use_ok 'Thrasher::Component';
15 use_ok 'Thrasher::Plugin', qw(:all);
16 use_ok 'Thrasher::Plugin::EntityCapabilities';
17 use_ok 'Thrasher::Backend::Test';
20 my $comp = logged_in_comp;
21 $comp->send_presence_xml('test@test.com', '');
22 my $expected = clean_xml(<<EXPECTED);
23 <presence from='test.transport'
24 to='test\@test.com'>
25 <c hash='sha-1'
26 node='http://developer.berlios.de/projects/thrasher/'
27 ver='vEhfNTvdI3o4kgwbVxIGfxr9S2g'
28 xmlns='http://jabber.org/protocol/caps'/>
29 </presence>
30 EXPECTED
32 is(output, $expected, 'caps correctly adds the capability tag for the transport');
34 $comp->send_presence_xml('test@test.com', 'juliet@' . transport_jid);
35 $expected = clean_xml(<<EXPECTED);
36 <presence from='test.transport'
37 to='test\@test.com'
38 type='juliet\@test.transport'>
39 <c hash='sha-1'
40 node='http://developer.berlios.de/projects/thrasher/'
41 ver='vEhfNTvdI3o4kgwbVxIGfxr9S2g'
42 xmlns='http://jabber.org/protocol/caps'/>
43 </presence>
44 EXPECTED
46 is(output, $expected, 'caps correctly adds the capability tag for '
47 .'the virtual users');