[BUGFIX] Warning in RecordCollectionRepositoryTest
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 2 Sep 2012 13:50:40 +0000 (15:50 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Sun, 2 Sep 2012 13:54:53 +0000 (15:54 +0200)
RecordCollectionRepository calls fullQuoteStr() on DataHandler class. The
class is mocked in the tests, so there is no real database link.
fullQuoteStr() expects the link to be a resource, though. Solution is to
mock this method, too.

Change-Id: Id568f9fcef6a8e07dfe8ee4abce8f60d4cebf152
Resolves: #40529
Releases: 6.0
Reviewed-on: http://review.typo3.org/14290
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
typo3/sysext/core/Tests/Unit/Collection/RecordCollectionRepositoryTest.php

index 49e3c14..76e397a 100644 (file)
@@ -65,7 +65,10 @@ class RecordCollectionRepositoryTest extends \Tx_Phpunit_TestCase {
         * Sets up this test case.
         */
        protected function setUp() {
-               $this->databaseMock = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('exec_UPDATEquery', 'exec_SELECTgetSingleRow', 'exec_SELECTgetRows'));
+               $this->databaseMock = $this->getMock(
+                       'TYPO3\\CMS\\Core\\Database\\DatabaseConnection',
+                       array('exec_UPDATEquery', 'exec_SELECTgetSingleRow', 'exec_SELECTgetRows', 'fullQuoteStr')
+               );
                $this->fixture = $this->getMock('TYPO3\\CMS\\Core\\Collection\\RecordCollectionRepository', array('getDatabase'));
                $this->fixture->expects($this->any())->method('getDatabase')->will($this->returnValue($this->databaseMock));
                $this->testTableName = uniqid('tx_testtable');