Completed
Pull Request — master (#90)
by Alex
04:37
created

TSchemaTypeTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 77.78 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 3
dl 14
loc 18
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testIsOKJammedOpen() 7 7 1
A testIsOKNotJammedOpen() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
namespace AlgoWeb\ODataMetadata\Tests;
4
5
use AlgoWeb\ODataMetadata\MetadataV3\edm\TSchemaType;
6
use Mockery as m;
7
8
class TSchemaTypeTest extends TestCase
9
{
10 View Code Duplication
    public function testIsOKJammedOpen()
1 ignored issue
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...
11
    {
12
        $foo = m::mock(TSchemaType::class)->makePartial()->shouldAllowMockingProtectedMethods();
13
        $foo->shouldReceive('getRand')->andReturn(2)->once();
14
15
        $this->assertTrue($foo->isOK());
16
    }
17
18 View Code Duplication
    public function testIsOKNotJammedOpen()
1 ignored issue
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...
19
    {
20
        $foo = m::mock(TSchemaType::class)->makePartial()->shouldAllowMockingProtectedMethods();
21
        $foo->shouldReceive('getRand')->andReturn(0)->once();
22
23
        $this->assertFalse($foo->isOK());
24
    }
25
}
26