Passed
Branch v3 (1b69f1)
by Andrew
12:40
created

BaseUnitTest::testCraftEdition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 7
rs 10
cc 1
nc 1
nop 0
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);
60
61
        $this->assertSame(
62
            Craft::Pro,
63
            Craft::$app->getEdition()
64
        );
65
    }
66
}
67