/**
  * @test
  * @dataProvider dataProviderForCanConvert
  */
 public function canConvertFromReturnsTrueIfClassIsTaggedWithEntityOrValueObject($isEntity, $isValueObject, $expected)
 {
     if ($isEntity) {
         $this->mockReflectionService->expects($this->once())->method('isClassAnnotatedWith')->with('TheTargetType', 'TYPO3\\FLOW3\\Annotations\\Entity')->will($this->returnValue($isEntity));
     } else {
         $this->mockReflectionService->expects($this->at(0))->method('isClassAnnotatedWith')->with('TheTargetType', 'TYPO3\\FLOW3\\Annotations\\Entity')->will($this->returnValue($isEntity));
         $this->mockReflectionService->expects($this->at(1))->method('isClassAnnotatedWith')->with('TheTargetType', 'TYPO3\\FLOW3\\Annotations\\ValueObject')->will($this->returnValue($isValueObject));
     }
     $this->assertEquals($expected, $this->converter->canConvertFrom('myInputData', 'TheTargetType'));
 }
示例#2
0
 /**
  * @test
  */
 public function canConvertFromShouldReturnTrueForANullValue()
 {
     $this->assertTrue($this->converter->canConvertFrom(NULL, 'integer'));
 }
示例#3
0
 /**
  * @test
  */
 public function canConvertFromShouldReturnTrue()
 {
     $this->assertTrue($this->converter->canConvertFrom('myString', 'string'));
 }