Code Duplication    Length = 12-23 lines in 2 locations

src/Graviton/CoreBundle/Tests/Controller/AppControllerTest.php 1 location

@@ 121-143 (lines=23) @@
118
     *
119
     * @return void
120
     */
121
    public function testGetAppWithFilteringAndPaging()
122
    {
123
        $client = static::createRestClient();
124
        $client->request('GET', '/core/app/?eq(showInMenu,true)&limit(1)');
125
        $response = $client->getResponse();
126
127
        $this->assertEquals(1, count($client->getResults()));
128
129
        $this->assertContains(
130
            '<http://localhost/core/app/?eq(showInMenu%2Ctrue)&limit(1)>; rel="self"',
131
            $response->headers->get('Link')
132
        );
133
134
        $this->assertContains(
135
            '<http://localhost/core/app/?eq(showInMenu%2Ctrue)&limit(1%2C1)>; rel="next"',
136
            $response->headers->get('Link')
137
        );
138
139
        $this->assertContains(
140
            '<http://localhost/core/app/?eq(showInMenu%2Ctrue)&limit(1%2C1)>; rel="last"',
141
            $response->headers->get('Link')
142
        );
143
    }
144
145
    /**
146
     * rql limit() should *never* be overwritten by default value

src/Graviton/SecurityBundle/Tests/Controller/WhoAmIControllerTest.php 1 location

@@ 97-108 (lines=12) @@
94
     *
95
     * @return void
96
     */
97
    public function testWhoAmIActionExistingUserCookie()
98
    {
99
        $client = static::createRestClient();
100
        $client->getCookieJar()->set(new Cookie('x-graviton-user', 'fREd'));
101
102
        $client->request('GET', '/person/whoami');
103
104
        $this->assertSame('fred', $client->getResults()->username);
105
        $this->assertSame('Fred Feuz', $client->getResults()->name);
106
        $this->assertSame('Kirchweg 33', $client->getResults()->street);
107
        $this->assertSame('200', $client->getResults()->id);
108
    }
109
110
    /**
111
     * Tests if request with not existing user gives us anonymous