Example #1
0
 public function load(ObjectManager $manager)
 {
     $goodKey = $this->container->getParameter('test_config')['api_keys']['good_corp_key'];
     $corpManager = $this->container->get('app.corporation.manager');
     $apiManager = $this->container->get('app.apikey.manager');
     $key = new ApiCredentials();
     $key->setApiKey($goodKey['key'])->setVerificationCode($goodKey['code']);
     $res = $apiManager->validateAndUpdateApiKey($key, 'Corporation', '134217727');
     $apiManager->updateCorporationKey($key, $res);
     $corp = $corpManager->createNewCorporation($key);
     $manager->persist($corp);
     $manager->flush();
     $corpManager->checkCorporationDetails($corp);
     $manager->persist($corp);
     $manager->flush();
 }
 public function testGoodCorpKey()
 {
     $this->loadFixtures(['AppBundle\\DataFixtures\\Test\\LoadUserData']);
     $config = $this->getContainer()->getParameter('test_config');
     $key = new ApiCredentials();
     $api_key = $config['api_keys']['good_corp_key']['key'];
     $verification_code = $config['api_keys']['good_corp_key']['code'];
     $key->setApiKey($api_key)->setVerificationCode($verification_code);
     $res = $this->manager->validateKey($key, 'Corporation', '134217727');
     $this->manager->updateCorporationKey($key, $res);
     $this->assertSame('Corporation', $key->getType());
     $this->assertSame('134217727', $key->getAccessMask());
 }