public function testGetMostRecentInsight() { $dao = new InsightMySQLDAO(); $insight = $dao->getMostRecentInsight('not_a_real_slug', 10); $this->assertNull($insight); $builders[] = FixtureBuilder::build('insights', array('date' => '2012-06-15', 'slug' => 'slug', 'instance_id' => '1', 'headline' => 'Hooray!', 'text' => 'Newest', 'related_data' => serialize($owners), 'emphasis' => Insight::EMPHASIS_HIGH, 'time_updated' => '-1 day')); $builders[] = FixtureBuilder::build('insights', array('date' => '2012-06-15', 'slug' => 'slug', 'instance_id' => '1', 'headline' => 'Boo', 'text' => 'Older', 'related_data' => serialize($owners), 'emphasis' => Insight::EMPHASIS_HIGH, 'time_updated' => '-5 day')); $insight = $dao->getMostRecentInsight('slug', 1); $this->assertNotNull($insight); $this->assertEqual($insight->text, 'Newest'); $this->assertEqual($insight->headline, 'Hooray!'); }