本文整理汇总了PHP中Prophecy\Prophecy\ObjectProphecy::exec_SELECTgetSingleRow方法的典型用法代码示例。如果您正苦于以下问题:PHP ObjectProphecy::exec_SELECTgetSingleRow方法的具体用法?PHP ObjectProphecy::exec_SELECTgetSingleRow怎么用?PHP ObjectProphecy::exec_SELECTgetSingleRow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Prophecy\Prophecy\ObjectProphecy
的用法示例。
在下文中一共展示了ObjectProphecy::exec_SELECTgetSingleRow方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addDataThrowsExceptionIfDatabaseFetchingReturnsInvalidRowResultData
/**
* @test
*/
public function addDataThrowsExceptionIfDatabaseFetchingReturnsInvalidRowResultData()
{
$input = ['tableName' => 'tt_content', 'command' => 'edit', 'vanillaUid' => 10];
$this->dbProphecy->quoteStr(Argument::cetera())->willReturn($input['tableName']);
$this->dbProphecy->exec_SELECTgetSingleRow(Argument::cetera())->willReturn('invalid result data');
$this->setExpectedException(\UnexpectedValueException::class, '', 1437656323);
$this->subject->addData($input);
}
示例2: addDataSetsParentPageRowOnParentIfCommandIsEdit
/**
* @test
*/
public function addDataSetsParentPageRowOnParentIfCommandIsEdit()
{
$input = ['tableName' => 'tt_content', 'command' => 'edit', 'vanillaUid' => 123, 'databaseRow' => ['uid' => 123, 'pid' => 321]];
$parentPageRow = ['uid' => 321, 'pid' => 456];
$this->dbProphecy->quoteStr(Argument::cetera())->willReturnArgument(0);
$this->dbProphecy->exec_SELECTgetSingleRow('*', 'pages', 'uid=321')->willReturn($parentPageRow);
$result = $this->subject->addData($input);
$this->assertSame($parentPageRow, $result['parentPageRow']);
}
示例3: addDataSetsTypeValueFromNestedTcaGroupField
/**
* @test
*/
public function addDataSetsTypeValueFromNestedTcaGroupField()
{
$input = ['processedTca' => ['ctrl' => ['type' => 'uid_local:type'], 'columns' => ['uid_local' => ['config' => ['type' => 'group', 'internal_type' => 'db', 'size' => 1, 'maxitems' => 1, 'minitems' => 0, 'allowed' => 'sys_file']]], 'types' => ['2' => 'foo']], 'databaseRow' => ['uid_local' => 'sys_file_222|my_test.jpg']];
$foreignRecordResult = ['type' => 2];
// Required for BackendUtility::getRecord
$GLOBALS['TCA']['sys_file'] = array('foo');
$this->dbProphecy->exec_SELECTgetSingleRow('type', 'sys_file', 'uid=222')->shouldBeCalled()->willReturn($foreignRecordResult);
$expected = $input;
$expected['recordTypeValue'] = '2';
$this->assertSame($expected, $this->subject->addData($input));
}
示例4: addDataResolvesLanguageIsocodeFromStaticInfoTable
/**
* @test
*/
public function addDataResolvesLanguageIsocodeFromStaticInfoTable()
{
if (ExtensionManagementUtility::isLoaded('static_info_tables') === false) {
$this->markTestSkipped('no ext:static_info_tables available');
}
$dbRows = [['uid' => 3, 'title' => 'french', 'language_isocode' => '', 'static_lang_isocode' => 42, 'flag' => 'fr']];
$this->dbProphecy->exec_SELECTgetRows('uid,title,language_isocode,static_lang_isocode,flag', 'sys_language', 'pid=0')->shouldBeCalled()->willReturn($dbRows);
// Needed for backendUtility::getRecord()
$GLOBALS['TCA']['static_languages'] = ['foo'];
$this->dbProphecy->exec_SELECTgetSingleRow('lg_iso_2', 'static_languages', 'uid=42')->shouldBeCalled()->willReturn(['lg_iso_2' => 'FR']);
$expected = ['systemLanguageRows' => [-1 => ['uid' => -1, 'title' => 'LLL:EXT:lang/locallang_mod_web_list.xlf:multipleLanguages', 'iso' => 'DEF', 'flagIconIdentifier' => 'flags-multiple'], 0 => ['uid' => 0, 'title' => 'LLL:EXT:lang/locallang_mod_web_list.xlf:defaultLanguage', 'iso' => 'DEF', 'flagIconIdentifier' => 'empty-empty'], 3 => ['uid' => 3, 'title' => 'french', 'flagIconIdentifier' => 'flags-fr', 'iso' => 'FR']]];
$this->assertSame($expected, $this->subject->addData([]));
}
示例5: addDataSetsDoesNotAddHandledRowAsAdditionalLanguageRows
/**
* @test
*/
public function addDataSetsDoesNotAddHandledRowAsAdditionalLanguageRows()
{
$input = ['tableName' => 'tt_content', 'databaseRow' => ['uid' => 42, 'text' => 'localized text', 'sys_language_uid' => 2, 'l10n_parent' => 23], 'processedTca' => ['ctrl' => ['languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent']], 'userTsConfig' => ['options.' => ['additionalPreviewLanguages' => '2,3']], 'systemLanguageRows' => [0 => ['uid' => 0, 'title' => 'Default Language', 'iso' => 'DEV'], 2 => ['uid' => 2, 'title' => 'dansk', 'iso' => 'dk,'], 3 => ['uid' => 3, 'title' => 'french', 'iso' => 'fr']], 'defaultLanguageRow' => null, 'additionalLanguageRows' => []];
$translationResult = ['translations' => [3 => ['uid' => 43]]];
// For BackendUtility::getRecord()
$GLOBALS['TCA']['tt_content'] = array('foo');
$recordWsolResult = ['uid' => 43, 'text' => 'localized text in french'];
$defaultLanguageRow = ['uid' => 23, 'text' => 'default language text', 'sys_language_uid' => 0];
// Needed for BackendUtility::getRecord
$GLOBALS['TCA']['tt_content'] = array('foo');
$this->dbProphecy->exec_SELECTgetSingleRow('*', 'tt_content', 'uid=23')->shouldBeCalled()->willReturn($defaultLanguageRow);
/** @var TranslationConfigurationProvider|ObjectProphecy $translationProphecy */
$translationProphecy = $this->prophesize(TranslationConfigurationProvider::class);
GeneralUtility::addInstance(TranslationConfigurationProvider::class, $translationProphecy->reveal());
$translationProphecy->translationInfo('tt_content', 23, 3)->shouldBeCalled()->willReturn($translationResult);
$translationProphecy->translationInfo('tt_content', 23, 2)->shouldNotBeCalled();
// This is the real check: The "additional overlay" should be fetched
$this->dbProphecy->exec_SELECTgetSingleRow('*', 'tt_content', 'uid=43')->shouldBeCalled()->willReturn($recordWsolResult);
$expected = $input;
$expected['defaultLanguageRow'] = $defaultLanguageRow;
$expected['additionalLanguageRows'] = [3 => ['uid' => 43, 'text' => 'localized text in french']];
$this->assertEquals($expected, $this->subject->addData($input));
}