public function testRequestWithValidXAuthToken()
 {
     $client = static::createClient();
     $client->request('GET', static::URL_DECONNECTION);
     $client->request('GET', '/api/wsse/v1/user/authentication', array(), array(), array('HTTP_X-WSSE' => WsseProvider::makeToken(UsersFixtures::USER_USERNAME, UsersFixtures::USER_PASSWORD)), '');
     $this->assertEquals(200, $client->getResponse()->getStatusCode());
 }
 public function testIfRequestHaveValidUsernamePasswordHaveInformationAboutUser()
 {
     $this->client->request('GET', '/api/wsse/v1/user/authentication', array(), array(), array('HTTP_X-WSSE' => WsseProvider::makeToken(UsersFixtures::USER_USERNAME, UsersFixtures::USER_PASSWORD)), '');
     $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
     //
     $return = json_decode($this->client->getResponse()->getContent(), true);
     //
     $this->assertTrue(array_key_exists('userid', $return));
     $this->assertTrue(array_key_exists('username', $return));
     $this->assertTrue(array_key_exists('firstname', $return));
     $this->assertTrue(array_key_exists('lastname', $return));
     $this->assertTrue(array_key_exists('email', $return));
     $this->assertTrue(array_key_exists('address', $return));
     $this->assertTrue(array_key_exists('cp', $return));
     $this->assertTrue(array_key_exists('city', $return));
     $this->assertTrue(array_key_exists('country', $return));
 }
 public function testIfRequestHaveValideDatsResponseHaveA201StatusCode()
 {
     $this->client->request('POST', '/api/wsse/v1/user/create', array(), array(), array('HTTP_X-WSSE' => WsseProvider::makeToken(UsersFixtures::ADMIN_USERNAME, UsersFixtures::ADMIN_PASSWORD)), static::getUserDataInJson(array()));
     $this->assertEquals(201, $this->client->getResponse()->getStatusCode());
     $return = json_decode($this->client->getResponse()->getContent(), true);
     $this->assertTrue(isset($return['userid']), "new created user information are return");
     $this->assertEquals(static::$UserFixtures['email'], $return['email']);
 }