17 use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
29 protected function setUp()
31 $this->converter = new \TYPO3\CMS\Extbase\Property\TypeConverter\ArrayConverter();
39 $this->assertEquals([
'array',
'string'], $this->converter->getSupportedSourceTypes(),
'Source types do not match');
40 $this->assertEquals(
'array', $this->converter->getSupportedTargetType(),
'Target type does not match');
41 $this->assertEquals(10, $this->converter->getPriority(),
'Priority does not match');
49 $sourceArray = [
'Foo' =>
'Bar',
'Baz'];
50 $this->assertEquals($sourceArray, $this->converter->convertFrom($sourceArray,
'array'));
59 'Empty string to empty array' => [
'', []],
72 $this->assertEquals($expectedResult, $this->converter->convertFrom($source,
'array'));
81 'Can convert empty string' => [
'',
true],
82 'Can not convert not empty string' => [
'foo',
false],
83 'Can convert array' => [[
'foo'],
true],
96 $this->assertSame($expectedResult, $this->converter->canConvertFrom($source,
'array'));