Ticket #180 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

PDO échout 2 tests (ACL) dans les tests unitaires

Reported by: turowbye Assigned to: laurentj
Priority: highest Milestone: Jelix 1.0beta3
Component: jelix Version: 1.0 beta2
Severity: critical Keywords: pdo db dao
Cc: Php version:
Review: Hosting Provider:
Documentation needed: Blocking:

Description (Last modified by laurentj)

J'utilise Windows.

Dans les tests unitaires "testapp", lorsque j'utilise le profil pour PDO

  • Le test jAcl : passe
  • Le test jAclManager : échec
  • Le test jAclUserGroup : échec

Si j'utilise le profil pour mysql, il n'y a aucun problème.

Example de l'erreur produite sous le profile pour PDO.

Fail: testAddSubject -> jacl_subject table should contains given records.. Not found record : array ( 'id_aclsbj' => 'super.cms', 'id_aclvalgrp' => 2, 'label_key' => 'cms~rights.super.cms', ) at C:\xampp\htdocs\jelix\testapp\modules\unittest\classes\utjaclmanager.class.php line 63

Fail: testAddSubject -> jacl_subject table should contains given records.. Other unknow records exists at C:\xampp\htdocs\jelix\testapp\modules\unittest\classes\utjaclmanager.class.php line 63

Results from database

Array
(
    [0] => 
)

Records we should find

Array
(
    [0] => Array
        (
            [id_aclsbj] => super.cms
            [id_aclvalgrp] => 2
            [label_key] => cms~rights.super.cms
        )

)

Change History

05/27/07 10:47:07 changed by laurentj

  • status changed from new to assigned.
  • description changed.
  • priority changed from normal to highest.
  • milestone set to Jelix 1.0beta3.
  • owner set to laurentj.
  • severity changed from normal to critical.

je confirme le bug :-(

05/28/07 14:56:21 changed by laurentj

  • keywords set to pdo db dao.
  • status changed from assigned to closed.
  • resolution set to fixed.

Bug corrigé dans le trunk.

Il s'agit en fait à l'origine d'un bug dans PDO de php. Lors de l'utilisation en tant qu'itérateur d'une classe qui hérite de PDOstatement, PDO appelle directement les méthodes de PDOStatement, et non celles de la classe héritière.

Plus concrètement, avec le driver pdo, jDb renvoyait les résultats dans des tableaux au lieu d'objets. Ce qui provoquait des disfonctionnements dans les dao etc..

Download in other formats: Comma-delimited Text Tab-delimited Text RSS Feed