public function testGetFallbacks()
{
$category = new Category();
$category->setDefaultLocale('en');
$categoryTrans = new CategoryTranslation();
$categoryTrans->setLocale('en');
$categoryTrans->setTranslation('EN');
$categoryTrans->setCategory($category);
$category->addTranslation($categoryTrans);
$categoryTrans = new CategoryTranslation();
$categoryTrans->setLocale('en_us');
$categoryTrans->setTranslation('EN-US');
$categoryTrans->setCategory($category);
$category->addTranslation($categoryTrans);
$this->em->persist($category);
$this->em->flush();
$client = $this->createAuthenticatedClient();
$client->request('GET', '/api/categories/' . $category->getId() . '?locale=de');
$response = json_decode($client->getResponse()->getContent());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals('en', $response->locale);
$this->assertEquals('en', $response->defaultLocale);
$this->assertEquals('EN', $response->name);
$client->request('GET', '/api/categories/' . $category->getId() . '?locale=en_us');
$response = json_decode($client->getResponse()->getContent());
$this->assertEquals(200, $client->getResponse()->getStatusCode());
$this->assertEquals('en_us', $response->locale);
$this->assertEquals('en', $response->defaultLocale);
$this->assertEquals('EN-US', $response->name);
}