Changeset 2951

Show
Ignore:
Timestamp:
07/24/08 10:04:01 (1 month ago)
Author:
alexandrej
Message:

Ajout de tests unitaires

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php

    r2949 r2951  
    2323    } 
    2424     
    25     public function testgetNextVersion () { 
     25    public function testGetNextVersion () { 
    2626        $this->assertTrue(_class('heading|HeadingElementInformationServices')->getNextVersion(37) === 1); 
    2727    } 
    2828     
     29    public function testDeleteById () { 
     30        CopixDb::getConnection()->doQuery("INSERT INTO `headingelementinformation` (`id_hei`, `id_helt`, `type_hei`, `public_id_hei`, `site_id_hei`, `parent_heading_public_id_hei`, `author_id_create_hei`, `author_handler_create_hei`, `author_caption_create_hei`, `date_create_hei`, `author_id_update_hei`, `author_handler_udpate_hei`, `author_caption_update_hei`, `date_update_hei`, `comment_hei`, `caption_hei`, `published_date_hei`, `end_published_date_hei`, `status_hei`, `version_hei`, `from_version_hei`, `show_in_menu_hei`, `base_url_hei`, `url_id_hei`, `public_id_root_menu_hei`, `public_id_contextual_menu_hei`, `theme_id_hei`) VALUES 
     31(1, 10, 'heading', 1, 'principal', 0, NULL, NULL, NULL, '2008-07-23 16:46:24', NULL, NULL, NULL, '2008-07-23 16:46:24', NULL, 'Rubrique testée 20080723164624', NULL, NULL, '3', 0, 0, 0, NULL, NULL, NULL, NULL, NULL)"); 
     32        $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteById(1950) !== false); 
     33    } 
     34     
     35    public function testDeleteByPublicId () { 
     36        CopixDb::getConnection()->doQuery("INSERT INTO `headingelementinformation` (`id_hei`, `id_helt`, `type_hei`, `public_id_hei`, `site_id_hei`, `parent_heading_public_id_hei`, `author_id_create_hei`, `author_handler_create_hei`, `author_caption_create_hei`, `date_create_hei`, `author_id_update_hei`, `author_handler_udpate_hei`, `author_caption_update_hei`, `date_update_hei`, `comment_hei`, `caption_hei`, `published_date_hei`, `end_published_date_hei`, `status_hei`, `version_hei`, `from_version_hei`, `show_in_menu_hei`, `base_url_hei`, `url_id_hei`, `public_id_root_menu_hei`, `public_id_contextual_menu_hei`, `theme_id_hei`) VALUES 
     37        (1, 10, 'heading', 1, 'principal', 0, NULL, NULL, NULL, '2008-07-23 16:46:24', NULL, NULL, NULL, '2008-07-23 16:46:24', NULL, 'Rubrique testée 20080723164624', NULL, NULL, '3', 0, 0, 0, NULL, NULL, NULL, NULL, NULL)"); 
     38        $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteByPublicId (1)); 
     39    } 
     40     
    2941}