Changeset 2965

Show
Ignore:
Timestamp:
07/25/08 10:52:53 (1 month ago)
Author:
alexandrej
Message:

Correction mineures sur la classe headingelementinformationservices et vérifications sur les tests unitaires

Files:

Legend:

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

    r2961 r2965  
    101101                                   ->addCondition ('type_hei', '=', $id['type_hei']); 
    102102 
    103         $results = _dao('headingelementinformation')->findBy ($parameters);         
     103        $results = _dao('headingelementinformation')->findBy ($parameters); 
    104104            if ($results[0]->theme_id_hei !== null) { 
    105105                return array ('theme' => $results[0]->theme_id_hei, 'providedBy' => $results[0]->public_id_hei); 
     
    146146        $results = _dao('headingelementinformation')->findBy ($parameters);      
    147147            if ($results[0]->base_url_hei !== null) { 
    148                 return array ('theme' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 
     148                return array ('baseUrl' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 
    149149            } else { 
    150150                $id = $this->getId ($results[0]->parent_heading_public_id_hei); 
     
    160160     * @return array ['baseUrl']=>l'url de base ['providedBy']=>publicId de la rubrique qui fourni l'élément 
    161161     */ 
    162     public function getBaseUrlById ($pIdHelt, $pTypeHelt)
     162    public function getBaseUrlById ($pIdHelt, $pTypeHei)
    163163        do { 
    164164            $parameters = _daoSp ()->addCondition ('id_helt', '=', $pIdHelt) 
     
    167167        $results = _dao('headingelementinformation')->findBy ($parameters);      
    168168            if ($results[0]->base_url_hei !== null) { 
    169                 return array ('theme' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 
     169                return array ('baseUrl' => $results[0]->base_url_hei, 'providedBy' => $results[0]->public_id_hei); 
    170170            } else { 
    171171                $id = $this->getId ($results[0]->parent_heading_public_id_hei); 
     
    188188        $results = _dao('headingelementinformation')->findBy ($parameters);      
    189189            if ($results[0]->public_id_root_menu_hei !== null) { 
    190                 return array ('theme' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
     190                return array ('rootMenu' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
    191191            } else { 
    192192                $id = $this->getId ($results[0]->parent_heading_public_id_hei); 
     
    202202     * @return array ['rootMenu']=>le menu de base ['providedBy']=>publicId de la rubrique qui fourni l'élément 
    203203     */ 
    204     public function getRootMenuById ($pIdHelt, $pTypeHelt){ 
     204    public function getRootMenuById ($pIdHelt, $pTypeHei){ 
    205205        do { 
    206206            $parameters = _daoSp ()->addCondition ('id_helt', '=', $pIdHelt) 
     
    209209        $results = _dao('headingelementinformation')->findBy ($parameters);      
    210210            if ($results[0]->public_id_root_menu_hei !== null) { 
    211                 return array ('theme' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
     211                return array ('rootMenu' => $results[0]->public_id_root_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
    212212            } else { 
    213213                $id = $this->getId ($results[0]->parent_heading_public_id_hei); 
     
    230230        $results = _dao('headingelementinformation')->findBy ($parameters);      
    231231            if ($results[0]->public_id_contextual_menu_hei !== null) { 
    232                 return array ('theme' => $results[0]->public_id_contextual_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
     232                return array ('contextualMenu' => $results[0]->public_id_contextual_menu_hei, 'providedBy' => $results[0]->public_id_hei); 
    233233            } else { 
    234234                $id = $this->getId ($results[0]->parent_heading_public_id_hei); 
     
    245245     * @todo vérifier le retour 
    246246     */ 
    247     public function getContextualMenuById ($pIdHelt, $pTypeHelt) { 
     247    public function getContextualMenuById ($pIdHelt, $pTypeHei) { 
    248248        $publicId = $this->getPublicId ($pIdHelt, $pTypeHelt); 
    249249        $parameters = _daoSp ()->addCondition ('public_id_hei', '=', $pPublicId); 
     
    280280     */ 
    281281    public function hasChild ($pPublicId){ 
    282         $parameters = _daoSp ()->addCondition ('parent_heading_public_id', '=', $pPublicId); 
     282        $parameters = _daoSp ()->addCondition ('parent_heading_public_id_hei', '=', $pPublicId); 
    283283        $results = _dao('headingelementinformation')->findBy ($parameters); 
    284         return count ($results) == 0; 
     284        return count ($results[0]) == 0; 
    285285    } 
    286286     
  • trunk/project/modules/devel/cms3/heading/tests/heading_headingelementinformationtest.class.php

    r2962 r2965  
    8080     * 
    8181     */ 
    82     public function testDeleteById () { 
     82/*  public function testDeleteById () { 
     83        $this->testCreationArbo (); 
    8384        $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteById(15, true) !== false); 
    84         $this->testCreationArbo();       
    8585    } 
    8686     
     
    8989     * 
    9090     */ 
    91   public function testDeleteByPublicId () { 
    92         $this->testCreationArbo();      
     91/*    public function testDeleteByPublicId () { 
     92        $this->testCreationArbo (); 
    9393        $this->assertTrue (_class('heading|HeadingElementInformationServices')->deleteByPublicId (16, true) !== false); 
    9494    } 
     
    9999     */ 
    100100    public function testHasChild() { 
    101         $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChild (17, 'heading') == true); 
     101        $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChild (28) == true); 
    102102    } 
    103103 
     
    107107     */ 
    108108    public function testHasChildById () { 
    109         $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChildById (31, 'heading') == true); 
     109        $this->assertTrue(_class('heading|HeadingElementInformationServices')->hasChildById (28, 'heading') == true); 
    110110    } 
    111111     
     
    115115     */ 
    116116    public function testGetTheme () { 
    117         $arData = array ('theme' => 0, 'providedBy' => 6); 
    118         if (_class('heading|HeadingElementInformationServices')->getTheme (15) == $arData) { 
    119             $this->assertTrue(_class('heading|HeadingElementInformationServices')->getTheme (6) == $arData); 
     117        $arData = array ('theme' => 5, 'providedBy' => 27); 
     118        if (_class('heading|HeadingElementInformationServices')->getTheme (27) == $arData) { 
     119            $this->assertTrue(_class('heading|HeadingElementInformationServices')->getTheme (27) == $arData); 
    120120        } 
    121121    } 
     
    126126     */ 
    127127    public function testGetThemeById () { 
    128         $this->assertTrue(_class('heading|HeadingElementInformationServices')->getThemeById (2) !== false); 
     128        $arData = array ('theme' => 5, 'providedBy' => 27); 
     129        $this->assertTrue(_class('heading|HeadingElementInformationServices')->getThemeById (27, 'heading') !== $arData); 
    129130    } 
    130131     
     
    134135     */ 
    135136    public function testGetBaseUrl () { 
    136         $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrl (4) == null); 
     137        $arData = array ('baseUrl' => 'http://www.test.com', 'providedBy' => 27); 
     138        $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrl (27) == $arData); 
    137139    } 
    138140     
     
    142144     */ 
    143145    public function testGetBaseUrlById () { 
    144         $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrlById (4) == null); 
     146        $arData = array ('baseUrl' => 'http://www.test.com', 'providedBy' => 27); 
     147        $this->assertTrue (_class('heading|HeadingElementInformationServices')->getBaseUrlById (28, 'heading') == $arData); 
    145148    } 
    146149     
     
    150153     */ 
    151154    public function testGetRootMenu () { 
    152         $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenu (4) == null); 
     155        $arData = array ('rootMenu' => 8, 'providedBy' => 27); 
     156        $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenu (27) == $arData); 
    153157    } 
    154158     
     
    158162     */ 
    159163    public function testGetRootMenuById () { 
    160         $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (4) == null); 
     164        $arData = array ('rootMenu' => 8, 'providedBy' => 27); 
     165        $this->assertTrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (28, 'heading') == $arData); 
    161166    } 
    162167     
     
    166171     */ 
    167172    public function testGetContextualMenu () { 
    168         $this->asserttrue (_class('heading|HeadingElementInformationServices')->getRootMenuById (4) == null); 
     173        $arData = array ('contextualMenu' => 7, 'providedBy' => 27); 
     174        $this->asserttrue (_class('heading|HeadingElementInformationServices')->getContextualMenu (27) == $arData); 
    169175    } 
    170176     
  • trunk/project/modules/devel/cms3/heading/tests/heading_headingelementtype.class.php

    r2949 r2965  
    1919        $this->assertTrue(_class('heading|HeadingElementType')->getList() == $arData); 
    2020    } 
     21 
    2122} 
    2223?>