con); $this->books = PropelQuery::from('Book')->setFormatter(ModelCriteria::FORMAT_ON_DEMAND)->find(); } public function testSetFormatter() { $this->assertTrue($this->books instanceof PropelOnDemandCollection); $this->assertEquals(4, count($this->books)); } public function testKeys() { $i = 0; foreach ($this->books as $key => $book) { $this->assertEquals($i, $key); $i++; } } /** * @expectedException PropelException */ public function testoffsetExists() { $this->books->offsetExists(2); } /** * @expectedException PropelException */ public function testoffsetGet() { $this->books->offsetGet(2); } /** * @expectedException PropelException */ public function testoffsetSet() { $this->books->offsetSet(2, 'foo'); } /** * @expectedException PropelException */ public function testoffsetUnset() { $this->books->offsetUnset(2); } }