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.

LanguageTest   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 20
dl 0
loc 46
rs 10
c 1
b 0
f 0
wmc 7

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testResourceIndex() 0 9 2
A testLanguagesBestFit() 0 8 1
A testResourceSearch() 0 9 2
A testLanguagesIndex() 0 9 2
1
<?php
2
3
namespace NStack\Tests;
4
5
use NStack\Clients\LanguagesClient;
6
use NStack\Clients\LocalizeClient;
7
use NStack\Models\Language;
8
9
class LanguageTest extends TestCase
10
{
11
    public function testResourceIndex()
12
    {
13
        $client = $this->getClientWithMockedGet('languages-index.json');
14
15
        $client = new LanguagesClient($this->getConfig(), $client);
16
        $list = $client->index();
17
18
        foreach ($list as $language) {
19
            $this->assertInstanceOf(Language::class, $language);
20
        }
21
    }
22
23
    public function testResourceSearch()
24
    {
25
        $client = $this->getClientWithMockedGet('languages-search.json');
26
27
        $client = new LanguagesClient($this->getConfig(), $client);
28
        $list = $client->search("br");
29
30
        foreach ($list as $language) {
31
            $this->assertInstanceOf(Language::class, $language);
32
        }
33
    }
34
35
    public function testLanguagesIndex()
36
    {
37
        $client = $this->getClientWithMockedGet('localize-languages-index.json');
38
39
        $client = new LocalizeClient($this->getConfig(), $client);
40
        $list = $client->indexLanguage('mobile');
41
42
        foreach ($list as $continent) {
43
            $this->assertInstanceOf(Language::class, $continent);
44
        }
45
    }
46
47
    public function testLanguagesBestFit()
48
    {
49
        $client = $this->getClientWithMockedGet('localize-languages-best-fit.json');
50
51
        $client = new LocalizeClient($this->getConfig(), $client);
52
        $language = $client->bestFitLanguage('mobile');
53
54
        $this->assertInstanceOf(Language::class, $language);
55
    }
56
}
57