testDiffForHumansLocalizedInPortugueseBrazil()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4286
cc 1
eloc 7
nc 1
nop 0
1
<?php
2
3
namespace HMLB\Date\Tests\Localization;
4
5
/*
6
 * This file is part of the Date package.
7
 *
8
 * (c) Hugues Maignol <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
use HMLB\Date\Date;
15
use HMLB\Date\Tests\AbstractTestCase;
16
17
class PtTest extends AbstractTestCase
18
{
19 View Code Duplication
    public function testDiffForHumansLocalizedInPortuguese()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
20
    {
21
        Date::setLocale('pt');
22
23
        $scope = $this;
24
        $this->wrapWithTestNow(
25
            function () use ($scope) {
26
                $d = Date::now()->subSecond();
27
                $scope->assertSame('1 segundo atrás', $d->diffForHumans());
28
            }
29
        );
30
    }
31
32 View Code Duplication
    public function testDiffForHumansLocalizedInPortugueseBrazil()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
33
    {
34
        Date::setLocale('pt-BR');
35
36
        $scope = $this;
37
        $this->wrapWithTestNow(
38
            function () use ($scope) {
39
                $d = Date::now()->subSecond();
40
                $scope->assertSame('há 1 segundo', $d->diffForHumans());
41
            }
42
        );
43
    }
44
45 View Code Duplication
    public function testDiffForHumansLocalizedInPortugueseBrazilBC()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
46
    {
47
        Date::setLocale('pt_BR');
48
49
        $scope = $this;
50
        $this->wrapWithTestNow(
51
            function () use ($scope) {
52
                $d = Date::now()->subSecond();
53
                $scope->assertSame('há 1 segundo', $d->diffForHumans());
54
            }
55
        );
56
    }
57
}
58