Issues (257)

tests/unit/BaseUnitTest.php (2 issues)

1
<?php
2
/**
3
 * SEOmatic plugin for Craft CMS 3.x
4
 *
5
 * A turnkey SEO implementation for Craft CMS that is comprehensive, powerful,
6
 * and flexible
7
 *
8
 * @link      https://nystudio107.com
9
 * @copyright Copyright (c) 2020 nystudio107
10
 */
11
12
namespace nystudio107\seomatictests\unit;
13
14
use Codeception\Test\Unit;
15
use UnitTester;
16
use Craft;
17
use nystudio107\seomatic\Seomatic;
18
19
/**
20
 * ExampleUnitTest
21
 *
22
 * @author    nystudio107
23
 * @package   Seomatic
24
 * @since     3.3.9
25
 */
26
class BaseUnitTest extends Unit
27
{
28
    // Properties
29
    // =========================================================================
30
31
    /**
32
     * @var UnitTester
33
     */
34
    protected $tester;
35
36
    // Public methods
37
    // =========================================================================
38
39
    // Tests
40
    // =========================================================================
41
42
    /**
43
     *
44
     */
45
    public function testPluginInstance()
46
    {
47
        $this->assertInstanceOf(
48
            Seomatic::class,
49
            Seomatic::$plugin
50
        );
51
    }
52
53
    /**
54
     *
55
     */
56
    public function testCraftEdition()
57
    {
58
        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

58
        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...
59
60
        $this->assertSame(
61
            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

61
            /** @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...
62
            Craft::$app->getEdition()
63
        );
64
    }
65
}
66