Example #1
0
 /**
  * @test
  * @dataProvider collectionTypes
  * @param string $type
  */
 public function isMultiValuedPropertyReturnsTrueForCollectionTypes($type)
 {
     $classSchema = new \TYPO3\FLOW3\Reflection\ClassSchema('SomeClass');
     $classSchema->addProperty('testProperty', $type);
     $this->assertTrue($classSchema->isMultiValuedProperty('testProperty'));
 }
Example #2
0
 /**
  * @test
  */
 public function mapSplObjectStorageCreatesSplObjectStorage()
 {
     $objectData = array(array('value' => array('mappedObject1')), array('value' => array('mappedObject2')));
     $classSchema = new \TYPO3\FLOW3\Reflection\ClassSchema('TYPO3\\Post');
     $classSchema->addProperty('firstProperty', 'SplObjectStorage');
     $dataMapper = $this->getAccessibleMock('TYPO3\\FLOW3\\Persistence\\Generic\\DataMapper', array('mapToObject'));
     $dataMapper->expects($this->at(0))->method('mapToObject')->with($objectData[0]['value'])->will($this->returnValue(new \stdClass()));
     $dataMapper->expects($this->at(1))->method('mapToObject')->with($objectData[1]['value'])->will($this->returnValue(new \stdClass()));
     $dataMapper->_call('mapSplObjectStorage', $objectData);
 }