Changeset 1415


Ignore:
Timestamp:
Sep 25, 2010, 9:56:07 PM (10 years ago)
Author:
teymour
Message:

Test unitaire sur le index_if

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/test/unit/solrableTest.php

    r1372 r1415  
    44 
    55new sfDatabaseManager(ProjectConfiguration::getApplicationConfiguration('frontend', 'test', true));
    6 $t = new lime_test(13);
     6$t = new lime_test(17);
    77
    88$s = new SolrConnector();
     
    9494$t->is(count($r['response']['docs']), 0, "La question ecrite a été supprimée");
    9595
     96$c = new Commentaire();
     97$c->commentaire = "commentaire test";
     98$c->is_public = 0;
     99$c->object_type = "Parlementaire";
     100$c->object_id = "1";
     101$c->citoyen_id = 2;
     102
     103$c->save();
     104$s->updateFromCommands();
     105$id = $c->id;
     106$r = $s->search("id:Commentaire/$id");
     107$t->is(count($r['response']['docs']), 0, "Le commentaire n'est pas trouvable car is_public = 0");
     108
     109$c = Doctrine::getTable('Commentaire')->find($id);
     110$c->is_public = 1;
     111$c->save();
     112$s->updateFromCommands();
     113$r = $s->search("id:Commentaire/$id");
     114$t->is(count($r['response']['docs']), 1, "Le commentaire est trouvable car is_public = 1");
     115
     116$c = Doctrine::getTable('Commentaire')->find($id);
     117$c->is_public = 0;
     118$c->save();
     119$s->updateFromCommands();
     120$r = $s->search("id:Commentaire/$id");
     121$t->is(count($r['response']['docs']), 0, "Le commentaire n'est pas trouvable car is_public = 0");
     122
     123$c->delete();
     124$s->updateFromCommands();
     125$r = $s->search("id:Commentaire/$id");
     126$t->is(count($r['response']['docs']), 0, "Le commentaire n'est pas trouvable car il est supprimé");
Note: See TracChangeset for help on using the changeset viewer.