Revert "[BUGFIX] MM_match_fields is ignored when persisting MM relations"
authorHelmut Hummel <helmut.hummel@typo3.org>
Tue, 27 Nov 2012 10:03:18 +0000 (11:03 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Tue, 27 Nov 2012 10:09:54 +0000 (11:09 +0100)
This reverts commit 423ff57f029150e1cceb99d35eb5a4b77381f6e3

Change-Id: I597afa00b42a2e0ba55d23df85d6c25d2774387e
Reviewed-on: http://review.typo3.org/16787
Reviewed-by: Helmut Hummel
Tested-by: Helmut Hummel
typo3/sysext/extbase/Classes/Persistence/Generic/Backend.php
typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php [deleted file]

index 9eee192..5b49d95 100644 (file)
@@ -643,12 +643,6 @@ class Backend implements \TYPO3\CMS\Extbase\Persistence\Generic\BackendInterface
                if ($columnMap->getRelationTablePageIdColumnName() !== NULL) {
                        $row[$columnMap->getRelationTablePageIdColumnName()] = $this->determineStoragePageIdForNewRecord();
                }
-               $relationTableMatchFields = $columnMap->getRelationTableMatchFields();
-               if (count($relationTableMatchFields)) {
-                       foreach ($relationTableMatchFields as $matchField => $matchValue) {
-                               $row[$matchField] = $matchValue;
-                       }
-               }
                $relationTableInsertFields = $columnMap->getRelationTableInsertFields();
                if (count($relationTableInsertFields)) {
                        foreach ($relationTableInsertFields as $insertField => $insertValue) {
diff --git a/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php b/typo3/sysext/extbase/Tests/Unit/Persistence/Generic/BackendTest.php
deleted file mode 100644 (file)
index 56e2aa2..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-<?php
-namespace TYPO3\CMS\Extbase\Tests\Unit\Persistence\Generic;
-
-/***********************************************************************
- *  Copyright notice
- *
- *  (c) 2012 Kai Vogel <kai.vogel@speedprogs.de>, Speedprogs.de
- *
- *  All rights reserved
- *
- *  This script is part of the TYPO3 project. The TYPO3 project is
- *  free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  The GNU General Public License can be found at
- *  http://www.gnu.org/copyleft/gpl.html.
- *
- *  This script is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  This copyright notice MUST APPEAR in all copies of the script!
- **********************************************************************/
-
-class BackendTest extends \TYPO3\CMS\Extbase\Tests\Unit\BaseTestCase {
-
-       /**
-        * @test
-        */
-       public function insertRelationInRelationtableSetsMmMatchFieldsIntoRow() {
-               /* \TYPO3\CMS\Extbase\Persistence\Generic\Backend|\PHPUnit_Framework_MockObject_MockObject|\TYPO3\CMS\Core\Tests\AccessibleObjectInterface */
-               $fixture = $this->getAccessibleMock('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\Backend', array('dummy'), array(), '', FALSE);
-               /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMapper|\PHPUnit_Framework_MockObject_MockObject */
-               $dataMapper = $this->getMock('TYPO3\\CMS\Extbase\\Persistence\\Generic\\Mapper\\DataMapper');
-               /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\DataMap|\PHPUnit_Framework_MockObject_MockObject */
-               $dataMap = $this->getMock('TYPO3\\CMS\Extbase\\Persistence\\Generic\\Mapper\\DataMap');
-               /* \TYPO3\CMS\Extbase\Persistence\Generic\Mapper\ColumnMap|\PHPUnit_Framework_MockObject_MockObject */
-               $columnMap = $this->getMock('TYPO3\\CMS\Extbase\\Persistence\\Generic\\Mapper\\ColumnMap');
-               /* \TYPO3\CMS\Extbase\Persistence\Generic\Storage\BackendInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $storageBackend = $this->getMock('TYPO3\\CMS\Extbase\\Persistence\\Generic\\Storage\\BackendInterface');
-               /* \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface|\PHPUnit_Framework_MockObject_MockObject */
-               $domainObject = $this->getMock('TYPO3\\CMS\Extbase\\DomainObject\\DomainObjectInterface');
-               $mmMatchFields = array(
-                       'identifier' => 'myTable:myField',
-               );
-               $expectedRow = array(
-                       'identifier' => 'myTable:myField',
-                       '' => 0
-               );
-               $columnMap
-                       ->expects($this->once())
-                       ->method('getRelationTableMatchFields')
-                       ->will($this->returnValue($mmMatchFields));
-               $columnMap
-                       ->expects($this->any())
-                       ->method('getChildSortByFieldName')
-                       ->will($this->returnValue(''));
-               $dataMap
-                       ->expects($this->any())
-                       ->method('getColumnMap')
-                       ->will($this->returnValue($columnMap));
-               $dataMapper
-                       ->expects($this->any())
-                       ->method('getDataMap')
-                       ->will($this->returnValue($dataMap));
-               $storageBackend
-                       ->expects($this->once())
-                       ->method('addRow')
-                       ->with(NULL, $expectedRow, TRUE);
-               $fixture->_set('dataMapper', $dataMapper);
-               $fixture->_set('storageBackend', $storageBackend);
-               $fixture->_call('insertRelationInRelationtable', $domainObject, $domainObject, '');
-       }
-
-}
-?>
\ No newline at end of file