/** * @test */ public function doesFindByTypeAndTableNameReturnObjects() { $testUid = rand(1, 1000); $testTable = uniqid('sys_collection_'); $type = \TYPO3\CMS\Core\Collection\RecordCollectionRepository::TYPE_Static; $this->databaseMock->expects($this->once())->method('exec_SELECTgetRows')->will($this->returnCallback(array($this, 'getRowsCallback'))); $this->getRowsCallbackReturnValue = array(array('uid' => $testUid, 'type' => $type, 'table_name' => $this->testTableName), array('uid' => $testUid, 'type' => $type, 'table_name' => $this->testTableName)); $objects = $this->fixture->findByTypeAndTableName($type, $testTable); $this->assertEquals(2, count($objects)); $this->assertInstanceOf('TYPO3\\CMS\\Core\\Collection\\StaticRecordCollection', $objects[0]); $this->assertInstanceOf('TYPO3\\CMS\\Core\\Collection\\StaticRecordCollection', $objects[1]); }