| Conditions | 1 |
| Paths | 1 |
| Total Lines | 138 |
| Code Lines | 91 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
| 1 | <?php |
||
| 75 | function testFindObjsInSchemas() |
||
| 76 | {
|
||
| 77 | global $webUrl; |
||
| 78 | global $lang, $SERVER, $DATABASE; |
||
| 79 | |||
| 80 | // Locate the list page of databases. |
||
| 81 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 82 | 'server' => $SERVER, |
||
| 83 | 'database' => $DATABASE, |
||
| 84 | 'subject' => 'database', |
||
| 85 | 'action' => 'find')) |
||
| 86 | ); |
||
| 87 | |||
| 88 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 89 | $this->assertTrue($this->setField('filter', 'Schemas'));
|
||
| 90 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 91 | |||
| 92 | // Locate the list page of databases. |
||
| 93 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 94 | 'server' => $SERVER, |
||
| 95 | 'database' => $DATABASE, |
||
| 96 | 'subject' => 'database', |
||
| 97 | 'action' => 'find')) |
||
| 98 | ); |
||
| 99 | |||
| 100 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 101 | $this->assertTrue($this->setField('filter', 'Tables'));
|
||
| 102 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 103 | |||
| 104 | // Locate the list page of databases. |
||
| 105 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 106 | 'server' => $SERVER, |
||
| 107 | 'database' => $DATABASE, |
||
| 108 | 'subject' => 'database', |
||
| 109 | 'action' => 'find')) |
||
| 110 | ); |
||
| 111 | |||
| 112 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 113 | $this->assertTrue($this->setField('filter', 'Views'));
|
||
| 114 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 115 | |||
| 116 | // Locate the list page of databases. |
||
| 117 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 118 | 'server' => $SERVER, |
||
| 119 | 'database' => $DATABASE, |
||
| 120 | 'subject' => 'database', |
||
| 121 | 'action' => 'find')) |
||
| 122 | ); |
||
| 123 | |||
| 124 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 125 | $this->assertTrue($this->setField('filter', 'Sequences'));
|
||
| 126 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 127 | |||
| 128 | // Locate the list page of databases. |
||
| 129 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 130 | 'server' => $SERVER, |
||
| 131 | 'database' => $DATABASE, |
||
| 132 | 'subject' => 'database', |
||
| 133 | 'action' => 'find')) |
||
| 134 | ); |
||
| 135 | |||
| 136 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 137 | $this->assertTrue($this->setField('filter', 'Columns'));
|
||
| 138 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 139 | |||
| 140 | // Locate the list page of databases. |
||
| 141 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 142 | 'server' => $SERVER, |
||
| 143 | 'database' => $DATABASE, |
||
| 144 | 'subject' => 'database', |
||
| 145 | 'action' => 'find')) |
||
| 146 | ); |
||
| 147 | |||
| 148 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 149 | $this->assertTrue($this->setField('filter', 'Rules'));
|
||
| 150 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 151 | |||
| 152 | // Locate the list page of databases. |
||
| 153 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 154 | 'server' => $SERVER, |
||
| 155 | 'database' => $DATABASE, |
||
| 156 | 'subject' => 'database', |
||
| 157 | 'action' => 'find')) |
||
| 158 | ); |
||
| 159 | |||
| 160 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 161 | $this->assertTrue($this->setField('filter', 'Indexes'));
|
||
| 162 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 163 | |||
| 164 | // Locate the list page of databases. |
||
| 165 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 166 | 'server' => $SERVER, |
||
| 167 | 'database' => $DATABASE, |
||
| 168 | 'subject' => 'database', |
||
| 169 | 'action' => 'find')) |
||
| 170 | ); |
||
| 171 | |||
| 172 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 173 | $this->assertTrue($this->setField('filter', 'Triggers'));
|
||
| 174 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 175 | |||
| 176 | // Locate the list page of databases. |
||
| 177 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 178 | 'server' => $SERVER, |
||
| 179 | 'database' => $DATABASE, |
||
| 180 | 'subject' => 'database', |
||
| 181 | 'action' => 'find')) |
||
| 182 | ); |
||
| 183 | |||
| 184 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 185 | $this->assertTrue($this->setField('filter', 'Constraints'));
|
||
| 186 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 187 | |||
| 188 | // Locate the list page of databases. |
||
| 189 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 190 | 'server' => $SERVER, |
||
| 191 | 'database' => $DATABASE, |
||
| 192 | 'subject' => 'database', |
||
| 193 | 'action' => 'find')) |
||
| 194 | ); |
||
| 195 | |||
| 196 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 197 | $this->assertTrue($this->setField('filter', 'Functions'));
|
||
| 198 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 199 | |||
| 200 | // Locate the list page of databases. |
||
| 201 | $this->assertTrue($this->get("$webUrl/database.php", array(
|
||
| 202 | 'server' => $SERVER, |
||
| 203 | 'database' => $DATABASE, |
||
| 204 | 'subject' => 'database', |
||
| 205 | 'action' => 'find')) |
||
| 206 | ); |
||
| 207 | |||
| 208 | $this->assertTrue($this->setField('term', 'student'));
|
||
| 209 | $this->assertTrue($this->setField('filter', 'Domains'));
|
||
| 210 | $this->assertTrue($this->clickSubmit ($lang['strfind'])); |
||
| 211 | |||
| 212 | return true; |
||
| 213 | } |
||
| 239 |