GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 7d8259...93df27 )
by Alexsandr
02:41
created

YandexMarketYmlModuleTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 7

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
lcom 0
cbo 7
dl 0
loc 58
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A testBuildYml() 0 55 1
1
<?php
2
3
namespace tests;
4
5
use Yii;
6
use tests\models\Category;
7
use corpsepk\yml\models\Shop;
8
use corpsepk\yml\models\Offer;
9
use corpsepk\yml\YandexMarketYml;
10
11
/**
12
 * BuildYmlTest
13
 */
14
class YandexMarketYmlModuleTest extends \PHPUnit_Framework_TestCase
15
{
16
    public function testBuildYml()
17
    {
18
        Yii::$app->setModule('YandexMarketYml', [
19
            'class' => YandexMarketYml::className(),
20
            'cacheProvider' => new \yii\caching\DummyCache(),
21
        ]);
22
23
        /** @var YandexMarketYml $module */
24
        $module = Yii::$app->getModule('YandexMarketYml');
25
        $actual = $module->createControllerByID('default')->renderPartial('index', [
26
            'shop' => new Shop([
27
                'name' => 'MyCompanyName',
28
                'company' => 'LTD MyCompanyName',
29
                'url' => 'http://example.com',
30
                'currencies' => [
31
                    ['id' => 'RUR', 'rate' => 1]
32
                ],
33
                'categories' => [
34
                    new Category([
35
                        'id' => 1,
36
                        'name' => 'First Category',
37
                        'parentId' => null,
38
                    ]),
39
                ],
40
                'offers' => [
41
                    new Offer([
42
                        'id' => 1,
43
                        'available' => true,
44
                        'url' => 'http://example.com/item/1',
45
                        'price' => 1560,
46
                        'currencyId' => 'RUR',
47
                        'categoryId' => 1,
48
                        'picture' => 'http://example.com/images/1.jpg',
49
                        'name' => 'Jacket',
50
                        'vendor' => 'Manufacturer',
51
                        'description' => 'Item description',
52
                    ]),
53
                    new Offer([
54
                        'id' => 2,
55
                        'available' => false,
56
                        'url' => 'http://example.com/item/2',
57
                        'price' => 2360,
58
                        'currencyId' => 'RUR',
59
                        'categoryId' => 1,
60
                        'picture' => 'http://example.com/images/2.jpg',
61
                        'name' => 'T-shirt',
62
                        'vendor' => 'Manufacturer',
63
                        'description' => 'Items description',
64
                    ]),
65
                ]
66
            ]),
67
        ]);
68
        $expected = file_get_contents(__DIR__ . '/data/yml.bin');
69
        $this->assertEquals($expected, $actual);
70
    }
71
}