@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | public static function suite() { |
| 6 | 6 | $suite = new CakeTestSuite('All model tests.'); |
| 7 | - $suite->addTestDirectory(TESTS . 'Case' . DS . 'Model'); |
|
| 7 | + $suite->addTestDirectory(TESTS.'Case'.DS.'Model'); |
|
| 8 | 8 | return $suite; |
| 9 | 9 | } |
| 10 | 10 | |
@@ -187,7 +187,7 @@ discard block |
||
| 187 | 187 | * but within one second time diff |
| 188 | 188 | */ |
| 189 | 189 | $diff = $now->diff($_lastLogin); |
| 190 | - $result = (int)$diff->format("s"); |
|
| 190 | + $result = (int) $diff->format("s"); |
|
| 191 | 191 | $expected = 1; |
| 192 | 192 | $this->assertLessThanOrEqual($expected, $result); |
| 193 | 193 | $this->assertGreaterThanOrEqual(0, $result); |
@@ -204,7 +204,7 @@ discard block |
||
| 204 | 204 | * but within one second time diff |
| 205 | 205 | */ |
| 206 | 206 | $diff = $now->diff($_lastLogin); |
| 207 | - $result = (int)$diff->format("s"); |
|
| 207 | + $result = (int) $diff->format("s"); |
|
| 208 | 208 | $expected = 1; |
| 209 | 209 | $this->assertLessThanOrEqual($expected, $result); |
| 210 | 210 | $this->assertGreaterThanOrEqual(0, $result); |
@@ -395,7 +395,7 @@ discard block |
||
| 395 | 395 | 'user_color_actual_posting' => '#', |
| 396 | 396 | ), |
| 397 | 397 | ); |
| 398 | - $result = $this->User->read(array( 'user_color_new_postings', 'user_color_old_postings', 'user_color_actual_posting' )); |
|
| 398 | + $result = $this->User->read(array('user_color_new_postings', 'user_color_old_postings', 'user_color_actual_posting')); |
|
| 399 | 399 | $this->assertEquals($expected, $result); |
| 400 | 400 | } |
| 401 | 401 | |
@@ -459,7 +459,7 @@ discard block |
||
| 459 | 459 | */ |
| 460 | 460 | public function testGetUsersForEventOnSubject() { |
| 461 | 461 | $expected = array( |
| 462 | - (int)0 => array( |
|
| 462 | + (int) 0 => array( |
|
| 463 | 463 | 'id' => '1', |
| 464 | 464 | 'username' => 'Alice', |
| 465 | 465 | 'user_email' => '[email protected]', |
@@ -470,7 +470,7 @@ discard block |
||
| 470 | 470 | 'esevent_id' => '1' |
| 471 | 471 | ) |
| 472 | 472 | ), |
| 473 | - (int)1 => array( |
|
| 473 | + (int) 1 => array( |
|
| 474 | 474 | 'id' => '3', |
| 475 | 475 | 'username' => 'Ulysses', |
| 476 | 476 | 'user_email' => '[email protected]', |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | 'first', |
| 85 | 85 | ['contain' => false, 'order' => ['Entry.id' => 'DESC']] |
| 86 | 86 | ); |
| 87 | - $expectedThreadId = (int)$lastEntry['Entry']['tid'] + 1 . ''; |
|
| 87 | + $expectedThreadId = (int) $lastEntry['Entry']['tid'] + 1.''; |
|
| 88 | 88 | |
| 89 | 89 | $result = $this->Entry->createPosting($data); |
| 90 | 90 | |
@@ -191,19 +191,19 @@ discard block |
||
| 191 | 191 | // entry is not appended yet |
| 192 | 192 | $appendedEntry = $this->Entry->find( |
| 193 | 193 | 'count', array( |
| 194 | - 'conditions' => array ('Entry.id' => 4, 'Entry.pid' => 2 ))); |
|
| 194 | + 'conditions' => array('Entry.id' => 4, 'Entry.pid' => 2))); |
|
| 195 | 195 | $this->assertEquals($appendedEntry, 0); |
| 196 | 196 | |
| 197 | 197 | // count both threads |
| 198 | - $targetEntryCount = $this->Entry->find('count', array('conditions' => array ('tid' => '1'))); |
|
| 199 | - $sourceEntryCount = $this->Entry->find('count', array('conditions' => array ('tid' => '4'))); |
|
| 198 | + $targetEntryCount = $this->Entry->find('count', array('conditions' => array('tid' => '1'))); |
|
| 199 | + $sourceEntryCount = $this->Entry->find('count', array('conditions' => array('tid' => '4'))); |
|
| 200 | 200 | |
| 201 | 201 | // do the merge |
| 202 | 202 | $this->Entry->id = 4; |
| 203 | 203 | $this->Entry->threadMerge(2); |
| 204 | 204 | |
| 205 | 205 | // target thread is contains now all entries |
| 206 | - $targetEntryCountAfterMerge = $this->Entry->find('count', array('conditions' => array ('tid' => '1'))); |
|
| 206 | + $targetEntryCountAfterMerge = $this->Entry->find('count', array('conditions' => array('tid' => '1'))); |
|
| 207 | 207 | $this->assertEquals($targetEntryCountAfterMerge, $sourceEntryCount + $targetEntryCount); |
| 208 | 208 | |
| 209 | 209 | //appended entries have category of target thread |
@@ -214,13 +214,13 @@ discard block |
||
| 214 | 214 | $this->assertEquals($targetCategoryCount, $targetEntryCount + $sourceEntryCount); |
| 215 | 215 | |
| 216 | 216 | // source thread is gone |
| 217 | - $sourceEntryCountAfterMerge = $this->Entry->find('count', array('conditions' => array ('tid' => '4'))); |
|
| 217 | + $sourceEntryCountAfterMerge = $this->Entry->find('count', array('conditions' => array('tid' => '4'))); |
|
| 218 | 218 | $this->assertEquals($sourceEntryCountAfterMerge, 0); |
| 219 | 219 | |
| 220 | 220 | // entry is appended now |
| 221 | 221 | $appendedEntry = $this->Entry->find( |
| 222 | 222 | 'count', array( |
| 223 | - 'conditions' => array ('Entry.id' => 4, 'Entry.pid' => '2' ))); |
|
| 223 | + 'conditions' => array('Entry.id' => 4, 'Entry.pid' => '2'))); |
|
| 224 | 224 | $this->assertEquals($appendedEntry, 1); |
| 225 | 225 | } |
| 226 | 226 | |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | public function testDeleteNodeCompleteThread() { |
| 367 | 367 | //* test thread exists before we delete it |
| 368 | 368 | $countBeforeDelete = $this->Entry->find('count', |
| 369 | - array('conditions' => array('tid' => '1') ) ); |
|
| 369 | + array('conditions' => array('tid' => '1'))); |
|
| 370 | 370 | $expected = 6; |
| 371 | 371 | $this->assertEquals($countBeforeDelete, $expected); |
| 372 | 372 | |
@@ -404,7 +404,7 @@ discard block |
||
| 404 | 404 | $this->assertTrue($result); |
| 405 | 405 | |
| 406 | 406 | $result = $this->Entry->find('count', |
| 407 | - array( 'conditions' => array( 'tid' => '1' ) )); |
|
| 407 | + array('conditions' => array('tid' => '1'))); |
|
| 408 | 408 | $expected = 0; |
| 409 | 409 | $this->assertEquals($result, $expected); |
| 410 | 410 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | $this->_startUsersOnline[0]['UserOnline'] = [ |
| 29 | 29 | 'uuid' => '5', |
| 30 | 30 | 'user_id' => 5, |
| 31 | - 'time' => (string)time(), |
|
| 31 | + 'time' => (string) time(), |
|
| 32 | 32 | 'logged_in' => true |
| 33 | 33 | ]; |
| 34 | 34 | $this->UserOnline->setOnline($_userId, true); |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | $this->_startUsersOnline[1]['UserOnline'] = [ |
| 49 | 49 | 'uuid' => substr(($_userId), 0, 32), |
| 50 | 50 | 'user_id' => null, |
| 51 | - 'time' => (string)time(), |
|
| 51 | + 'time' => (string) time(), |
|
| 52 | 52 | 'logged_in' => 0 |
| 53 | 53 | ]; |
| 54 | 54 | $this->UserOnline->setOnline($_userId, false); |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | class CategoryTest extends CakeTestCase { |
| 6 | 6 | |
| 7 | - public $fixtures = array( 'app.category', 'app.user', 'app.upload', 'app.user_online', 'app.entry' ); |
|
| 7 | + public $fixtures = array('app.category', 'app.user', 'app.upload', 'app.user_online', 'app.entry'); |
|
| 8 | 8 | |
| 9 | 9 | public function testGetCategoriesSelectForAccession() { |
| 10 | 10 | $result = $this->Category->getCategoriesForAccession(0); |
@@ -110,7 +110,7 @@ |
||
| 110 | 110 | |
| 111 | 111 | $this->generate('Uploads'); |
| 112 | 112 | $this->_loginUser(3); |
| 113 | - $result = $this->testAction( '/uploads/index', ['method' => 'GET', 'return' => 'contents'] |
|
| 113 | + $result = $this->testAction('/uploads/index', ['method' => 'GET', 'return' => 'contents'] |
|
| 114 | 114 | ); |
| 115 | 115 | $result = json_decode($result); |
| 116 | 116 | $this->assertCount(1, $result); |
@@ -325,7 +325,7 @@ |
||
| 325 | 325 | public function testRegisterCheckboxOnPageCustomTosUrl() { |
| 326 | 326 | Configure::write('Saito.Settings.tos_url', ''); |
| 327 | 327 | $result = $this->testAction('users/register', array('return' => 'view')); |
| 328 | - $this->assertContains($this->controller->request->webroot . 'pages/eng/tos', $result); |
|
| 328 | + $this->assertContains($this->controller->request->webroot.'pages/eng/tos', $result); |
|
| 329 | 329 | } |
| 330 | 330 | |
| 331 | 331 | /** |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | public function testAddSubjectToLong() { |
| 125 | - $Entries = $this->generate( 'Entries'); |
|
| 125 | + $Entries = $this->generate('Entries'); |
|
| 126 | 126 | $this->_loginUser(1); |
| 127 | 127 | |
| 128 | 128 | // maxlength attribute is set for textfield |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | ['data' => $data, 'method' => 'POST'] |
| 159 | 159 | ); |
| 160 | 160 | |
| 161 | - $this->assertRedirectedTo('entries/view/' . $id); |
|
| 161 | + $this->assertRedirectedTo('entries/view/'.$id); |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | public function testNoDirectCallOfAnsweringFormWithId() { |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | $Entries->Entry->expects($this->once()) |
| 718 | 718 | ->method('incrementViews') |
| 719 | 719 | ->with($id); |
| 720 | - $this->testAction('/entries/view/' . $id); |
|
| 720 | + $this->testAction('/entries/view/'.$id); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | public function testViewIncreaseViewCounterLoggedIn() { |
@@ -729,7 +729,7 @@ discard block |
||
| 729 | 729 | ->method('incrementViews') |
| 730 | 730 | ->with($id); |
| 731 | 731 | $this->_loginUser(1); |
| 732 | - $this->testAction('/entries/view/' . $id); |
|
| 732 | + $this->testAction('/entries/view/'.$id); |
|
| 733 | 733 | } |
| 734 | 734 | |
| 735 | 735 | /** |
@@ -744,7 +744,7 @@ discard block |
||
| 744 | 744 | |
| 745 | 745 | $Entries->Entry->expects($this->never()) |
| 746 | 746 | ->method('incrementViews'); |
| 747 | - $this->testAction('/entries/view/' . $id); |
|
| 747 | + $this->testAction('/entries/view/'.$id); |
|
| 748 | 748 | } |
| 749 | 749 | |
| 750 | 750 | /** |
@@ -760,7 +760,7 @@ discard block |
||
| 760 | 760 | $Entries->Entry->expects($this->never()) |
| 761 | 761 | ->method('incrementViews'); |
| 762 | 762 | |
| 763 | - $this->testAction('/entries/view/' . $id); |
|
| 763 | + $this->testAction('/entries/view/'.$id); |
|
| 764 | 764 | } |
| 765 | 765 | |
| 766 | 766 | public function testViewBoxFooter() { |
@@ -947,8 +947,8 @@ discard block |
||
| 947 | 947 | $result = $this->testAction('/entries/index', |
| 948 | 948 | ['method' => 'GET', 'return' => 'contents']); |
| 949 | 949 | $this->assertTextNotContains('noindex', $result); |
| 950 | - $expected = '<link rel="canonical" href="' . Router::url('/', |
|
| 951 | - true) . '"/>'; |
|
| 950 | + $expected = '<link rel="canonical" href="'.Router::url('/', |
|
| 951 | + true).'"/>'; |
|
| 952 | 952 | $this->assertTextContains($expected, $result); |
| 953 | 953 | |
| 954 | 954 | Configure::write('Saito.Settings.topics_per_page', 2); |