Passed
Push — master ( e1c5c8...a48a63 )
by Guillermo A.
08:16
created

ModelTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 6
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 6
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A testToJson() 0 4 1
1
<?php
2
3
namespace GuillermoandraeTest\Models;
4
5
use Guillermoandrae\Models\AbstractModel;
6
use PHPUnit\Framework\TestCase;
7
8
class ModelTest extends TestCase
9
{
10
    public function testToJson()
11
    {
12
        $model = $this->getMockForAbstractClass(AbstractModel::class);
13
        $this->assertSame(json_encode($model->toArray()), $model->toJson());
0 ignored issues
show
Bug introduced by
The method toArray() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $this->assertSame(json_encode($model->/** @scrutinizer ignore-call */ toArray()), $model->toJson());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
Bug introduced by
The method toJson() does not exist on PHPUnit\Framework\MockObject\MockObject. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

13
        $this->assertSame(json_encode($model->toArray()), $model->/** @scrutinizer ignore-call */ toJson());

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
14
    }
15
}
16