AuthBucket\Bundle\OAuth2Bundle\Tests\WebTestCase::setUp PHP Method

setUp() public method

public setUp ( )
    public function setUp()
    {
        static::bootKernel();
    }

Usage Example

 public function setUp()
 {
     parent::setUp();
     $container = new ContainerBuilder();
     $loader = new YamlFileLoader($container, new FileLocator(__DIR__ . '/../../Resources/config'));
     $loader->load('in_memory.yml');
     $container->compile();
     $this->set('authbucket_oauth2.model_manager.factory', $container->get('authbucket_oauth2.model_manager.factory'));
     $accessTokenManager = $this->get('authbucket_oauth2.model_manager.factory')->getModelManager('access_token');
     $className = $accessTokenManager->getClassName();
     $model = new $className();
     $model->setAccessToken('eeb5aa92bbb4b56373b9e0d00bc02d93')->setTokenType('bearer')->setClientId('http://democlient1.com/')->setUsername('demousername1')->setExpires(new \DateTime('+1 hours'))->setScope(array('demoscope1'));
     $accessTokenManager->createModel($model);
     $model = new $className();
     $model->setAccessToken('d2b58c4c6bc0cc9fefca2d558f1221a5')->setTokenType('bearer')->setClientId('http://democlient1.com/')->setUsername('demousername1')->setExpires(new \DateTime('-1 hours'))->setScope(array('demoscope1'));
     $accessTokenManager->createModel($model);
 }