ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilBuddySystemLinkedStateRelationTest.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Contact/BuddySystem/test/states/ilBuddySystemBaseStateTest.php';
5
11{
15 public function getInitialState()
16 {
18 }
19
23 public function testIsUnlinked()
24 {
25 $this->assertFalse($this->relation->isUnlinked());
26 }
27
31 public function testIsLinked()
32 {
33 $this->assertTrue($this->relation->isLinked());
34 }
35
39 public function testIsRequested()
40 {
41 $this->assertFalse($this->relation->isRequested());
42 }
43
47 public function testIsIgnored()
48 {
49 $this->assertFalse($this->relation->isIgnored());
50 }
51
55 public function testCanBeUnlinked()
56 {
57 $this->relation->unlink();
58 $this->assertTrue($this->relation->isUnlinked());
59 $this->assertTrue($this->relation->wasLinked());
60 }
61
65 public function testCanBeLinked()
66 {
67 $this->assertException(ilBuddySystemRelationStateException::class);
68 $this->relation->link();
69 }
70
74 public function testCanBeRequested()
75 {
76 $this->assertException(ilBuddySystemRelationStateException::class);
77 $this->relation->request();
78 }
79
83 public function testCanBeIgnored()
84 {
85 $this->assertException(ilBuddySystemRelationStateException::class);
86 $this->relation->ignore();
87 }
88}
An exception for terminatinating execution or to throw for unit testing.
Class ilBuddySystemBaseStateTest.
assertException($exception_class)
Class ilBuddySystemLinkedStateRelationTest.
testCanBeLinked()
@expectedException ilBuddySystemRelationStateException
testCanBeIgnored()
@expectedException ilBuddySystemRelationStateException
testCanBeRequested()
@expectedException ilBuddySystemRelationStateException