SaitoTableTestCase   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 31
rs 10
c 1
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A tearDown() 0 4 1
A setUp() 0 6 1
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 Saito\Test\Model\Table;
14
15
use Cake\ORM\Table;
16
use Cake\ORM\TableRegistry;
17
use Saito\Test\SaitoTestCase;
18
19
abstract class SaitoTableTestCase extends SaitoTestCase
20
{
21
22
    /**
23
     * @var string
24
     */
25
    public $tableClass;
26
27
    /**
28
     * @var Table
29
     */
30
    public $Table;
31
32
    /**
33
     * {@inheritDoc}
34
     */
35
    public function setUp()
36
    {
37
        parent::setUp();
38
39
        TableRegistry::clear();
0 ignored issues
show
Deprecated Code introduced by
The function Cake\ORM\TableRegistry::clear() has been deprecated: 3.6.0 Use \Cake\ORM\Locator\TableLocator::clear() instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

39
        /** @scrutinizer ignore-deprecated */ TableRegistry::clear();

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

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

Loading history...
40
        $this->Table = TableRegistry::get($this->tableClass);
0 ignored issues
show
Deprecated Code introduced by
The function Cake\ORM\TableRegistry::get() has been deprecated: 3.6.0 Use \Cake\ORM\Locator\TableLocator::get() instead. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

40
        $this->Table = /** @scrutinizer ignore-deprecated */ TableRegistry::get($this->tableClass);

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

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

Loading history...
41
    }
42
43
    /**
44
     * {@inheritDoc}
45
     */
46
    public function tearDown()
47
    {
48
        unset($this->Table);
49
        parent::tearDown();
50
    }
51
}
52