Code Duplication    Length = 11-12 lines in 4 locations

app/Plugin/Api/Test/Case/Controller/ApiUsersControllerTest.php 1 location

@@ 132-143 (lines=12) @@
129
			);
130
		}
131
132
		public function testMarkAsReadUserIdNotAuthorized() {
133
			$this->generate('Api.ApiUsers');
134
			$this->_loginUser(3);
135
			$data = [
136
				'id' => 1
137
			];
138
			$this->setExpectedException('ForbiddenException', 'You are not authorized for user id `1`.');
139
			$this->testAction(
140
				$this->_apiRoot . 'markasread',
141
				['method' => 'POST', 'data' => $data]
142
			);
143
		}
144
145
		public function testMarkAsReadSuccessNow() {
146
			$ApiUsers = $this->generate(

app/Test/Case/Controller/SearchesControllerTest.php 2 locations

@@ 41-51 (lines=11) @@
38
		/**
39
		 * Admin Category results should be in search results for admin
40
		 */
41
		public function testSimpleAccession() {
42
			$this->generate('Searches');
43
44
			$this->_notImplementedOnDatasource('Postgres');
45
46
			$this->_loginUser(1);
47
48
			$result = $this->testAction('/searches/simple?q="Third+Thread+First_Subject"',
49
					['method' => 'GET', 'return' => 'vars']);
50
			$this->assertNotEmpty($result['results']);
51
		}
52
53
		/**
54
		 * Admin Category results shouldn't be in search results for user
@@ 56-66 (lines=11) @@
53
		/**
54
		 * Admin Category results shouldn't be in search results for user
55
		 */
56
		public function testSimpleNoAccession() {
57
			$this->generate('Searches');
58
59
			$this->_notImplementedOnDatasource('Postgres');
60
61
			$this->_loginUser(3);
62
63
			$result = $this->testAction('/searches/simple?q="Third+Thread+First_Subject"',
64
					['method' => 'GET', 'return' => 'vars']);
65
			$this->assertEmpty($result['results']);
66
		}
67
68
		/**
69
		 * Admin Category results should be in search results for admin

app/Test/Case/Controller/UsersControllerTest.php 1 location

@@ 496-506 (lines=11) @@
493
				'data' => ['slidetabKey' => $data]]);
494
		}
495
496
		public function testSlidetabToggleFailure() {
497
			$this->generate('Users');
498
			$this->_loginUser(3);
499
500
			$data = 'show_foo';
501
			$this->setExpectedException('BadRequestException', null, 1412949882);
502
503
			$this->_setAjax();
504
			$this->testAction('/users/slidetab_toggle', ['method' => 'POST',
505
				'data' => ['slidetabKey' => $data]]);
506
		}
507
508
		public function testViewProfileRequestByUsername() {
509
			$this->testAction('/users/view/Mitch');