Completed
Push — master ( 858a7e...01d609 )
by Mathieu
9s
created

setUp()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace LaravelFr\ApiTesting\Tests\AssertJsonResponse;
4
5
use Illuminate\Http\Response;
6
use PHPUnit_Framework_TestCase;
7
use LaravelFr\ApiTesting\AssertJsonResponse;
8
use Laravel\BrowserKitTesting\Concerns\MakesHttpRequests;
9
use LaravelFr\ApiTesting\Tests\Stubs\JsonSerializableMixedResourcesStub;
10
11
class AssertJsonResponseForOldVersionAndBrowserKitTest extends PHPUnit_Framework_TestCase
12
{
13
    use AssertJsonResponse, MakesHttpRequests;
14
15
    public function setUp()
16 View Code Duplication
    {
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...
17
        $this->stub = new JsonSerializableMixedResourcesStub;
18
        $this->response = new Response($this->stub);
19
    }
20
21
    public function testSeeJsonStructureEquals()
22
    {
23
        $this->assertJsonStructureEquals($this->stub->structure());
24
    }
25
26
    public function testJsonResponse()
27
    {
28
        $this->assertEquals(
29
            ['foobar_foo' => 'foo', 'foobar_bar' => 212],
30
            $this->jsonResponse('foobar')
31
        );
32
        $this->assertEquals(212, $this->jsonResponse('foobar.foobar_bar'));
33
    }
34
35
    public function testSeeJsonTypedStructure()
36
    {
37
        $this->seeJsonTypedStructure($this->stub->typedStructure());
38
    }
39
}
40