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.

MeasureManagerSpec::let()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 11
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace spec\Akeneo\Bundle\MeasureBundle\Manager;
4
5
use Akeneo\Bundle\MeasureBundle\Family\WeightFamilyInterface;
6
use PhpSpec\ObjectBehavior;
7
use Symfony\Component\Yaml\Yaml;
8
9
/**
10
 *
11
 * @author    Romain Monceau <[email protected]>
12
 * @copyright 2014 Akeneo SAS (http://www.akeneo.com)
13
 * @license   http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
14
 */
15
class MeasureManagerSpec extends ObjectBehavior
16
{
17
    public function let()
18
    {
19
        $filename = realpath(dirname(__FILE__) .'/../Resources/config/measure-test.yml');
20
        if (!file_exists($filename)) {
21
            throw new \Exception(sprintf('Config file "%s" does not exist', $filename));
22
        }
23
24
        $config = Yaml::parse(file_get_contents($filename));
25
26
        $this->setMeasureConfig($config['measures_config']);
27
    }
28
29
    public function it_throws_an_exception_when_try_to_get_symbols_of_unknown_family()
30
    {
31
        $this
32
            ->shouldThrow(
33
                new \InvalidArgumentException('Undefined measure family "foo"')
34
            )
35
            ->during('getUnitSymbolsForFamily', ['foo']);
36
    }
37
38
    public function it_returns_unit_symbols_list_from_a_family()
39
    {
40
        $this
41
            ->getUnitSymbolsForFamily(WeightFamilyInterface::FAMILY)
42
            ->shouldReturn(
43
                [
44
                    'MILLIGRAM' => 'mg',
45
                    'GRAM'      => 'g',
46
                    'KILOGRAM'  => 'kg'
47
                ]
48
            );
49
    }
50
51
    public function it_returns_standard_unit_for_a_family()
52
    {
53
        $this
54
            ->getStandardUnitForFamily(WeightFamilyInterface::FAMILY)
55
            ->shouldReturn(WeightFamilyInterface::GRAM);
56
    }
57
}
58