$article2->save(); $article3 = new DArticle(); $article3->setTitle('foo3'); $article3->save(); $finder = new sfDoctrineFinder('DArticle'); $articles = $finder->find(); $t->is(count($articles), 3, 'find() with no argument returns an array of all the records'); $articles = $articles->getData(); $article = array_shift($articles); $t->is($article->getTitle(), 'foo', 'find() with no argument returns an array of all the records'); $article = array_shift($articles); $t->is($article->getTitle(), 'foo2', 'find() with no argument returns an array of all the records'); $article = array_shift($articles); $t->is($article->getTitle(), 'foo3', 'find() with no argument returns an array of all the records'); $finder = new sfDoctrineFinder('DArticle'); $articles = $finder->find(2); $t->is(count($articles), 2, 'find() with an argument returns a limited array of records'); $t->diag('findOne()'); Doctrine_Query::create()->delete()->from('DArticle')->execute(); $finder = new sfDoctrineFinder('DArticle'); $article = $finder->findOne(); $t->is($article, null, 'findOne() returns null when no records match'); $article1 = new DArticle(); $article1->setTitle('foo'); $article1->save(); $article2 = new DArticle(); $article2->setTitle('foo2'); $article2->save(); $finder = new sfDoctrineFinder('DArticle'); $article = $finder->findOne(); $t->isa_ok($article, 'DArticle', 'findOne() returns a single object');