26 private $eventId = 12;
28 private $uploadTreeId = 5;
32 private $groupId = 123;
34 private $eventType = ClearingEventTypes::USER;
36 private $clearingLicense;
38 private $licenseDecisionEvent;
42 protected function setUp()
44 $this->timestamp = time();
45 $this->clearingLicense = M::mock(ClearingLicense::class);
47 $this->licenseDecisionEvent =
new ClearingEvent($this->eventId, $this->uploadTreeId, $this->timestamp, $this->userId, $this->groupId, $this->eventType, $this->clearingLicense);
48 $this->assertCountBefore = \Hamcrest\MatcherAssert::getCount();
51 protected function tearDown()
53 $this->addToAssertionCount(\Hamcrest\MatcherAssert::getCount()-$this->assertCountBefore);
56 public function testGetEventId()
58 assertThat($this->licenseDecisionEvent->getEventId(), is($this->eventId));
61 public function testGetEventType()
63 assertThat($this->licenseDecisionEvent->getEventType(), is($this->eventType));
66 public function testGetTimeStamp()
68 assertThat($this->licenseDecisionEvent->getTimeStamp(), is($this->timestamp));
71 public function testGetClearingLicense()
73 assertThat($this->licenseDecisionEvent->getClearingLicense(),
74 is($this->clearingLicense));
77 public function testGetUploadTreeId()
79 assertThat($this->licenseDecisionEvent->getUploadTreeId(),
80 is($this->uploadTreeId));
83 public function testGetLicenseId()
86 $this->clearingLicense->shouldReceive(
'getLicenseId')
89 ->andReturn($licenseId);
91 assertThat($this->licenseDecisionEvent->getLicenseId(), is($licenseId));
94 public function testGetLicenseShortName()
96 $licenseShortname =
"<licenseShortname>";
97 $this->clearingLicense->shouldReceive(
'getShortName')
100 ->andReturn($licenseShortname);
102 assertThat($this->licenseDecisionEvent->getLicenseShortName(),
103 is($licenseShortname));
106 public function testGetLicenseFullName()
108 $licenseFullname =
"<licenseFullname>";
109 $this->clearingLicense->shouldReceive(
'getFullName')
112 ->andReturn($licenseFullname);
114 assertThat($this->licenseDecisionEvent->getLicenseFullName(),
115 is($licenseFullname));
118 public function testGetUserId()
120 assertThat($this->licenseDecisionEvent->getUserId(), is($this->userId));
123 public function testGetGroupId()
125 assertThat($this->licenseDecisionEvent->getGroupId(), is($this->groupId));