Code Duplication    Length = 6-6 lines in 5 locations

tests/DNProjectTest.php 5 locations

@@ 148-153 (lines=6) @@
145
	/**
146
	 *
147
	 */
148
	public function testFooGroupIsAllowedToFooPermission() {
149
		$firstProject = $this->objFromFixture('DNProject', 'firstProject');
150
		$firstGroup = $this->objFromFixture('Group', 'firstWithCodeFoo');
151
		$isAllowed = $firstProject->groupAllowed('FOO_PERMISSION', $firstGroup);
152
		$this->assertTrue($isAllowed, 'Expected that foo group is allowed to foo perm');
153
	}
154
155
	public function testFooGroupIsNotAllowedToBarPermission() {
156
		$project = $this->objFromFixture('DNProject', 'firstProject');
@@ 155-160 (lines=6) @@
152
		$this->assertTrue($isAllowed, 'Expected that foo group is allowed to foo perm');
153
	}
154
155
	public function testFooGroupIsNotAllowedToBarPermission() {
156
		$project = $this->objFromFixture('DNProject', 'firstProject');
157
		$fooGroup = $this->objFromFixture('Group', 'firstWithCodeFoo');
158
		$isAllowed = $project->groupAllowed('BAR_PERMISSION', $fooGroup);
159
		$this->assertFalse($isAllowed, 'Expected that foo group should not have access to bar perm');
160
	}
161
162
	public function testBarGroupIsAllowedToBarPermission() {
163
		$firstProject = $this->objFromFixture('DNProject', 'firstProject');
@@ 162-167 (lines=6) @@
159
		$this->assertFalse($isAllowed, 'Expected that foo group should not have access to bar perm');
160
	}
161
162
	public function testBarGroupIsAllowedToBarPermission() {
163
		$firstProject = $this->objFromFixture('DNProject', 'firstProject');
164
		$secondGroup = $this->objFromFixture('Group', 'secondWithRoleBar');
165
		$isAllowed = $firstProject->groupAllowed('BAR_PERMISSION', $secondGroup);
166
		$this->assertTrue($isAllowed, 'Group should have "bar" PermissionRoleCode');
167
	}
168
169
	public function testSecondGroupIsNotAllowedToFirstProject() {
170
		$firstProject = $this->objFromFixture('DNProject', 'firstProject');
@@ 169-174 (lines=6) @@
166
		$this->assertTrue($isAllowed, 'Group should have "bar" PermissionRoleCode');
167
	}
168
169
	public function testSecondGroupIsNotAllowedToFirstProject() {
170
		$firstProject = $this->objFromFixture('DNProject', 'firstProject');
171
		$thirdGroup = $this->objFromFixture('Group', 'thirdWithCodeFoo');
172
		$isAllowed = $firstProject->groupAllowed('FOO_PERMISSION', $thirdGroup);
173
		$this->assertFalse($isAllowed, 'Expected that non project group should be denied');
174
	}
175
176
	public function testNonViewerGroupAllowedIsFalse() {
177
		$otherProject = $this->objFromFixture('DNProject', 'otherproject');
@@ 176-181 (lines=6) @@
173
		$this->assertFalse($isAllowed, 'Expected that non project group should be denied');
174
	}
175
176
	public function testNonViewerGroupAllowedIsFalse() {
177
		$otherProject = $this->objFromFixture('DNProject', 'otherproject');
178
		$firstGroup = $this->objFromFixture('Group', 'firstWithCodeFoo');
179
		$isAllowed = $otherProject->groupAllowed('FOO_PERMISSION', $firstGroup);
180
		$this->assertFalse($isAllowed, 'Expected that non project group should be denied');
181
	}
182
}
183