1<?php declare(strict_types=1);
2/* Copyright (c) 1998-2015 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Contact/BuddySystem/test/states/ilBuddySystemBaseStateTest.php';
5
6/**
7 * Class ilBuddySystemLinkedStateRelationTest
8 * @author Michael Jansen <mjansen@databay.de>
9 */
10class ilBuddySystemLinkedStateRelationTest extends ilBuddySystemBaseStateTest
11{
12    /**
13     * @inheritDoc
14     */
15    public function getInitialState() : ilBuddySystemRelationState
16    {
17        return new ilBuddySystemLinkedRelationState();
18    }
19
20    /**
21     *
22     */
23    public function testIsUnlinked() : void
24    {
25        $this->assertFalse($this->relation->isUnlinked());
26    }
27
28    /**
29     *
30     */
31    public function testIsLinked() : void
32    {
33        $this->assertTrue($this->relation->isLinked());
34    }
35
36    /**
37     *
38     */
39    public function testIsRequested() : void
40    {
41        $this->assertFalse($this->relation->isRequested());
42    }
43
44    /**
45     *
46     */
47    public function testIsIgnored() : void
48    {
49        $this->assertFalse($this->relation->isIgnored());
50    }
51
52    /**
53     *
54     */
55    public function testCanBeUnlinked() : void
56    {
57        $this->relation->unlink();
58        $this->assertTrue($this->relation->isUnlinked());
59        $this->assertTrue($this->relation->wasLinked());
60    }
61
62    /**
63     *
64     */
65    public function testCanBeLinked() : void
66    {
67        $this->expectException(ilBuddySystemRelationStateException::class);
68        $this->relation->link();
69    }
70
71    /**
72     *
73     */
74    public function testCanBeRequested() : void
75    {
76        $this->expectException(ilBuddySystemRelationStateException::class);
77        $this->relation->request();
78    }
79
80    /**
81     *
82     */
83    public function testCanBeIgnored() : void
84    {
85        $this->expectException(ilBuddySystemRelationStateException::class);
86        $this->relation->ignore();
87    }
88}
89