コード例 #1
0
  public function setUp() {
    parent::setup();

    $this->installConfig(array('pathauto', 'taxonomy', 'system', 'node'));

    $this->installEntitySchema('user');
    $this->installEntitySchema('node');
    $this->installEntitySchema('taxonomy_term');

    ConfigurableLanguage::createFromLangcode('fr')->save();

    $this->installSchema('node', array('node_access'));
    $this->installSchema('system', array('url_alias', 'sequences', 'router'));

    $type = NodeType::create(['type' => 'page']);
    $type->save();
    node_add_body_field($type);

    $this->nodePattern = $this->createPattern('node', '/content/[node:title]');
    $this->userPattern = $this->createPattern('user', '/users/[user:name]');

    \Drupal::service('router.builder')->rebuild();

    $this->currentUser = entity_create('user', array('name' => $this->randomMachineName()));
    $this->currentUser->save();
  }
コード例 #2
0
ファイル: PathautoUnitTest.php プロジェクト: dev981/gaptest
 public function setUp()
 {
     parent::setup();
     $this->installConfig(array('pathauto', 'taxonomy', 'system'));
     $this->installEntitySchema('user');
     $this->installEntitySchema('node');
     $this->installEntitySchema('taxonomy_term');
     $this->installSchema('node', array('node_access'));
     $this->installSchema('system', array('url_alias', 'sequences', 'router'));
     \Drupal::service('router.builder')->rebuild();
     $this->currentUser = entity_create('user', array('name' => $this->randomMachineName()));
     $this->currentUser->save();
 }
コード例 #3
0
 /**
  * {@inheritdoc}
  */
 protected function setUp()
 {
     parent::setup();
     $this->installEntitySchema('node');
     $this->installEntitySchema('taxonomy_term');
     $this->installEntitySchema('entity_test');
     $this->nodeType = NodeType::create(['type' => Unicode::strtolower($this->randomMachineName()), 'name' => $this->randomString()]);
     $this->nodeType->save();
     $this->vocabulary = Vocabulary::create(['vid' => Unicode::strtolower($this->randomMachineName()), 'name' => $this->randomString()]);
     $this->vocabulary->save();
     // Create a custom bundle.
     $this->customBundle = 'test_bundle_' . Unicode::strtolower($this->randomMachineName());
     entity_test_create_bundle($this->customBundle, NULL, 'entity_test');
 }
コード例 #4
0
ファイル: TypedDataTest.php プロジェクト: 318io/318-io
 protected function setUp()
 {
     parent::setup();
     $this->installEntitySchema('file');
     $this->typedDataManager = $this->container->get('typed_data_manager');
 }
コード例 #5
0
 protected function setUp()
 {
     parent::setup();
     $this->typedDataManager = $this->container->get('typed_data_manager');
 }