/** @test */ public function buildSelectPartWithSpecialStringReturnsExpectedString() { $pagerCollectionMock = $this->getMock('Tx_PtExtlist_Domain_Model_Pager_PagerCollection', array('setItemCount'), array(), '', false, false); $dataBackend = new Tx_PtExtlist_Domain_DataBackend_MySqlDataBackend_MySqlDataBackend($this->configurationBuilder); $dataBackend->_injectPagerCollection($pagerCollectionMock); $dataBackend->_injectQueryInterpreter(new Tx_PtExtlist_Domain_DataBackend_MySqlDataBackend_MySqlInterpreter_MySqlInterpreter()); $fieldConfigurationCollection = new Tx_PtExtlist_Domain_Configuration_Data_Fields_FieldConfigCollection(); $fieldConfigurationCollection->addItem($this->getFieldConfigMockForSpecialAndIdentifier('specialString', 'testFieldIdentifier')); $dataBackend->_injectFieldConfigurationCollection($fieldConfigurationCollection); $selectPartForFieldConfigurationCollection = $dataBackend->buildSelectPart(); $expectedSelectPart = '(specialString) AS testFieldIdentifier'; $this->assertTrue($selectPartForFieldConfigurationCollection == $expectedSelectPart, 'Select part for field configuration collection should be "' . $expectedSelectPart . '" but was ' . $selectPartForFieldConfigurationCollection); }