/**
  * Check if sanitizeSelectPart works as expected
  *
  * @dataProvider getQueryDataProvider
  * @test
  */
 public function getQuery($table, $conf, $expected)
 {
     $result = $this->cObj->getQuery($table, $conf, TRUE);
     foreach ($expected as $field => $value) {
         $this->assertEquals($value, $result[$field]);
     }
 }
Exemplo n.º 2
0
	/**
	 * @test
	 */
	public function getQueryCallsGetTreeListWithCurrentPageIfThisIsSet() {
		$GLOBALS['TCA'] = array(
			'pages' => array(
				'ctrl' => array(
					'enablecolumns' => array(
						'disabled' => 'hidden'
					)
				)
			),
			'tt_content' => array(
				'ctrl' => array(
					'enablecolumns' => array(
						'disabled' => 'hidden'
					)
				)
			),
		);
		$this->subject = $this->getAccessibleMock(\TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::class, array('getTreeList'));
		$GLOBALS['TSFE']->id = 27;
		$this->subject->start(array(), 'tt_content');
		$conf = array(
			'pidInList' => 'this',
			'recursive' => '4'
		);
		$this->subject->expects($this->once())
			->method('getTreeList')
			->with(-27)
			->will($this->returnValue('27'));
		$this->subject->getQuery('tt_content', $conf, TRUE);
	}