Completed
Branch feature/currentUserRefactoring (c13c1d)
by Schlaefer
04:13
created

UsersControllerTest::testDelete()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 51

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 51
rs 9.069
c 0
b 0
f 0

How to fix   Long Method   

Long Method

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:

1
<?php
2
3
declare(strict_types=1);
4
5
/**
6
 * Saito - The Threaded Web Forum
7
 *
8
 * @copyright Copyright (c) the Saito Project Developers
9
 * @link https://github.com/Schlaefer/Saito
10
 * @license http://opensource.org/licenses/MIT
11
 */
12
13
namespace App\Test\TestCase\Controller\Admin;
14
15
use Cake\ORM\TableRegistry;
16
use Saito\Test\IntegrationTestCase;
17
18
/**
19
 * Class CategoriesControllerTest
20
 *
21
 * @package App\Test\TestCase\Controller\Admin
22
 * @group App\Test\TestCase\Controller\Admin
23
 */
24
class UsersControllerTest extends IntegrationTestCase
25
{
26
27
    public $fixtures = [
28
        'app.Category',
29
        'app.Setting',
30
        'app.User',
31
        'app.UserBlock',
32
        'app.UserRead',
33
        'app.UserOnline',
34
    ];
35
36
    public function setUp()
37
    {
38
        parent::setUp();
39
        foreach (['Users'] as $table) {
40
            $this->$table = TableRegistry::get($table);
0 ignored issues
show
Deprecated Code introduced by
The method Cake\ORM\TableRegistry::get() has been deprecated with message: 3.6.0 Use \Cake\ORM\Locator\TableLocator::get() instead.

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
41
        }
42
    }
43
44
    public function testUsersIndexAccess()
45
    {
46
        $this->assertRouteForRole('/admin/users/block', 'admin');
47
    }
48
}
49