Exemple #1
0
 public function testGetIterator()
 {
     $this->assertInstanceOf('\\Iterator', $this->coll->getIterator());
 }
Exemple #2
0
 /**
  * @param mixed $offset
  */
 public function offsetUnset($offset)
 {
     parent::offsetUnset($offset);
     unset($this->identifiers[$offset]);
 }
Exemple #3
0
 /**
  * Info: This is a copy of "testNullableUniqueWorksForNotNullValues" with commented out first name!
  * Not give a field will be implicit accepted as NULL!
  *
  * @param string $database
  * @dataProvider provideDatabaseAwareTestCases
  */
 public function testFindByUniqueWithIncompleteFieldValues($database)
 {
     $rm = self::createRecordManager($database);
     $recordGenerator = self::createRecordGenerator($rm);
     $recordGenerator->setTableRows('author', $this->getNullableUniqueRowsForAuthor())->generate();
     $table = $rm->getTable('author');
     $records = $table->findByUniqueIndex('UNIQUE', array('lastname' => 'Anonymous'), RecordManager::FETCH_RECORD_COLLECTION);
     $expectedRecords = array('null_1', 'null_2', 'null_3');
     $this->assertInstanceOf('\\Dive\\Collection\\Collection', $records);
     $this->assertEquals(count($expectedRecords), $records->count());
     $expectedCollection = new Collection();
     foreach ($expectedRecords as $alias) {
         $id = $recordGenerator->getRecordIdFromMap('author', $alias);
         $expectedCollection->add($table->findByPk($id));
     }
     foreach ($expectedCollection as $index => $expected) {
         $this->assertSame($expected, $records[$index]);
     }
 }