Ojs\CoreBundle\Tests\BaseTestSetup::setUp PHP Метод

setUp() защищенный Метод

protected setUp ( )
    protected function setUp()
    {
        static::$kernel = static::createKernel();
        static::$kernel->boot();
        $container = static::$kernel->getContainer();
        $this->em = $container->get('doctrine')->getManager();
        $this->locale = $container->getParameter('locale');
        $this->secondLocale = array_values(array_diff($container->getParameter('locale_support'), [$this->locale]))[0];
        $this->router = $container->get('router');
        $this->sampleObjectLoader = $container->get('ojs_core.sample.object_loader');
        $baseUrl = $container->getParameter('base_host');
        $this->client = static::makeClient(array(), array('HTTP_HOST' => $baseUrl));
        $this->app = new Application($this->client->getKernel());
        $this->app->setAutoExit(false);
        $isPhpunitFastest = getenv('ENV_TEST_IS_FIRST_ON_CHANNEL');
        if ($isPhpunitFastest !== false) {
            return;
        }
        if (!$this->useCachedDatabase()) {
            $this->databaseInit();
        }
    }

Usage Example

Пример #1
0
 public function setUp()
 {
     parent::setUp();
     $this->apikey = $this->getApiKeyParams()['apikey'];
 }