views_natural_sort.test 1.35 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
<?php

class ViewsNaturalSortTest extends DrupalUnitTestCase {

  public static function getInfo() {
    return array(
      'name' => 'Views Natural Sort Tests',
      'description' => 'Test that Views Natural Sort Module works correctly.',
      'group' => 'VNS',
    );
  }
  
  public function testNodeAdd(){
    $node = new StdClass();
    $node->type = 'article';
    node_object_prepare($node);
    $node->title = 'All American';
    $node->status = 1;
    node_save($node);
    $this->assertNotNull($node->nid, 'The test node did not save properly.');
    $vns_entry = db_select('views_natural_sort','vns')
      ->fields('vns')
      ->condition('eid', $node->nid)
      ->execute()
      ->fetchAssoc();
    $this->assertEqual($vns_entry, array(
      'eid' => $node->nid,
      'entity_type' => 'node',
      'field' => 'title',
      'delta' => '0',
      'content' => 'All American'
    ));
  }
  
  public function testNodeRemove(){
    $this->assertTrue(FALSE);
  }

  public function testNodeChange(){
    $this->assertTrue(FALSE);
  }

  public function testRemoveBeginningWordsTransformation(){
    $this->assertTrue(FALSE);
  }

  public function testRemoveWordsTransformation(){
    $this->assertTrue(FALSE);
  }

  public function testNumberTransfomration(){
    $this->assertTrue(FALSE);
  }

  public function testViewSort(){
    $this->assertTrue(FALSE);
  }
}