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 ilBuddySystemRequestIgnoredStateRelationTest 8 * @author Michael Jansen <mjansen@databay.de> 9 */ 10class ilBuddySystemRequestIgnoredStateRelationTest extends ilBuddySystemBaseStateTest 11{ 12 /** 13 * @inheritDoc 14 */ 15 public function getInitialState() : ilBuddySystemRelationState 16 { 17 return new ilBuddySystemIgnoredRequestRelationState(); 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->assertFalse($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->assertTrue($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->wasIgnored()); 60 } 61 62 /** 63 * 64 */ 65 public function testCanBeLinked() : void 66 { 67 $this->relation->link(); 68 $this->assertTrue($this->relation->isLinked()); 69 $this->assertTrue($this->relation->wasIgnored()); 70 } 71 72 /** 73 * 74 */ 75 public function testCanBeRequested() : void 76 { 77 $this->expectException(ilBuddySystemRelationStateException::class); 78 $this->relation->request(); 79 } 80 81 /** 82 * 83 */ 84 public function testCanBeIgnored() : void 85 { 86 $this->expectException(ilBuddySystemRelationStateException::class); 87 $this->relation->ignore(); 88 } 89} 90