[BUGFIX] Fix PHP warning trigged in getAuthInfoArray()
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Tests / Unit / Authentication / AbstractUserAuthenticationTest.php
index c86262c..064345d 100644 (file)
@@ -151,6 +151,21 @@ class AbstractUserAuthenticationTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
                $this->assertEquals($mock->processLoginData($originalData, $passwordSubmissionStrategy), $processedData);
        }
 
                $this->assertEquals($mock->processLoginData($originalData, $passwordSubmissionStrategy), $processedData);
        }
 
+       /**
+        * @test
+        */
+       public function getAuthInfoArrayReturnsEmptyPidListIfNoCheckPidValueIsGiven() {
+               $GLOBALS['TYPO3_DB'] = $this->getMock('TYPO3\\CMS\\Core\\Database\\DatabaseConnection', array('cleanIntList'));
+               $GLOBALS['TYPO3_DB']->expects($this->never())->method('cleanIntList');
+
+               /** @var $mock \TYPO3\CMS\Core\Authentication\AbstractUserAuthentication */
+               $mock = $this->getMock('TYPO3\\CMS\\Core\\Authentication\\AbstractUserAuthentication', array('dummy'));
+               $mock->checkPid = TRUE;
+               $mock->checkPid_value = NULL;
+               $result = $mock->getAuthInfoArray();
+               $this->assertEquals('', $result['db_user']['checkPidList']);
+       }
+
 }
 
 ?>
\ No newline at end of file
 }
 
 ?>
\ No newline at end of file