You are here

function ABTEnviromentTestCase::envTestTermCreation in Access By Term 7

1 call to ABTEnviromentTestCase::envTestTermCreation()
ABTEnviromentTestCase::testEnviroment in ./abt.test

File

./abt.test, line 172

Class

ABTEnviromentTestCase

Code

function envTestTermCreation() {
  foreach ($this->terms as $vid => $terms) {
    $parent_tid = 0;
    for ($i = 0; $i < count($terms); $i++) {
      $loaded = taxonomy_term_load($terms[$i]->tid);
      $this
        ->assertEqual($loaded->name, $terms[$i]->name, t('Taxonomy term @tid was created.', array(
        '@tid' => $loaded->tid . ' - ' . $loaded->name,
      )));
      $this
        ->assertEqual($parent_tid, $terms[$i]->parent[0], t('Taxonomy term hierarchy confirmed: @parent -> @child ', array(
        '@parent' => $parent_tid,
        '@child' => $terms[$i]->tid,
      )));
      $parent_tid = $loaded->tid;
    }
  }
}