Issues (1783)

tests/unit/BaseUnitTest.php (2 issues)

1
<?php
2
/**
3
 * Retour plugin for Craft CMS 3.x
4
 *
5
 * Retour allows you to intelligently redirect legacy URLs, so that you don't
6
 * lose SEO value when rebuilding & restructuring a website
7
 *
8
 * @link      https://nystudio107.com/
9
 * @copyright Copyright (c) 2018 nystudio107
10
 */
11
12
namespace nystudio107\retourtests\unit;
13
14
use nystudio107\retour\Retour;
15
16
use Codeception\Test\Unit;
17
use UnitTester;
18
use Craft;
19
20
/**
21
 * ExampleUnitTest
22
 *
23
 * @author    nystudio107
24
 * @package   Retour
25
 * @since     3.1.40``
26
 */
27
class BaseUnitTest extends Unit
28
{
29
    // Properties
30
    // =========================================================================
31
32
    /**
33
     * @var UnitTester
34
     */
35
    protected $tester;
36
37
    // Public methods
38
    // =========================================================================
39
40
    // Tests
41
    // =========================================================================
42
43
    /**
44
     *
45
     */
46
    public function testPluginInstance()
47
    {
48
        $this->assertInstanceOf(
49
            Retour::class,
50
            Retour::$plugin
51
        );
52
    }
53
54
    /**
55
     *
56
     */
57
    public function testCraftEdition()
58
    {
59
        Craft::$app->setEdition(Craft::Pro);
0 ignored issues
show
Deprecated Code introduced by
The constant Craft::Pro has been deprecated: in 5.0.0. [[\craft\enums\CmsEdition::Pro]] should be used instead. ( Ignorable by Annotation )

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

59
        Craft::$app->setEdition(/** @scrutinizer ignore-deprecated */ Craft::Pro);

This class constant 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 constant will be removed from the class and what other constant to use instead.

Loading history...
60
61
        $this->assertSame(
62
            Craft::Pro,
0 ignored issues
show
Deprecated Code introduced by
The constant Craft::Pro has been deprecated: in 5.0.0. [[\craft\enums\CmsEdition::Pro]] should be used instead. ( Ignorable by Annotation )

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

62
            /** @scrutinizer ignore-deprecated */ Craft::Pro,

This class constant 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 constant will be removed from the class and what other constant to use instead.

Loading history...
63
            Craft::$app->getEdition()
64
        );
65
    }
66
}
67