public function testListCatalogues()
 {
     $client = $this->createAuthenticatedClient();
     $client->request('GET', '/api/catalogues?flat=true&fields=id,locale&packageId=' . $this->package->getId());
     $this->assertEquals('200', $client->getResponse()->getStatusCode());
     $response = json_decode($client->getResponse()->getContent());
     $this->assertEquals($this->catalogue->getId(), $response->_embedded->catalogues[0]->id);
     $this->assertEquals('EN', $response->_embedded->catalogues[0]->locale);
 }
Example #2
0
 public function testPutNotExistingLocation()
 {
     $request = ['code' => 'test.code.4', 'frontend' => '1', 'backend' => '0', 'length' => '20', 'package' => ['id' => $this->package2->getId()], 'location' => ['id' => 5123]];
     $this->client->request('PUT', '/api/codes/' . $this->code1->getId(), $request);
     $this->assertEquals(500, $this->client->getResponse()->getStatusCode());
     $this->client->request('GET', '/api/codes/' . $this->code1->getId());
     $response = json_decode($this->client->getResponse()->getContent());
     $this->assertEquals($this->code1->getCode(), $response->code);
     $this->assertEquals($this->code1->getBackend(), $response->backend);
     $this->assertEquals($this->code1->getFrontend(), $response->frontend);
     $this->assertEquals($this->code1->getLength(), $response->length);
     $this->assertEquals($this->code1->getLocation()->getId(), $response->location->id);
 }