$article3->setTitle('foo3');
$article3->save();
$finder = new sfDoctrineFinder('DArticle');
$nbDeleted = $finder->delete();
$t->is($nbDeleted, 2, 'delete() deletes records from the table and returns the number of deleted rows');
$finder = new sfDoctrineFinder('DArticle');
$nbArticles = $finder->count();
$t->is($nbArticles, 0, 'delete() on an empty finder deletes all rows');
$article2 = new DArticle();
$article2->setTitle('foo2');
$article2->save();
$article3 = new DArticle();
$article3->setTitle('foo3');
$article3->save();
$finder = new sfDoctrineFinder('DArticle');
$nbDeleted = $finder->where('Title', 'foo2')->delete();
$t->is($nbDeleted, 1, 'delete() deletes all rows found by a finder');
$nbArticles = $finder->count();
$t->is($nbArticles, 1, 'delete() does not delete rows not found by the finder');
$t->diag('where()');
Doctrine_Query::create()->delete()->from('DArticle')->execute();
$article1 = new DArticle();
$article1->setTitle('abc');
$article1->save();
$article2 = new DArticle();
$article2->setTitle('def');
$article2->save();
$article3 = new DArticle();
$article3->setTitle('bbc');
$article3->save();
$article = sfDoctrineFinder::from('DArticle')->where('Title', 'abc')->findOne();