当前位置: 首页>>代码示例>>PHP>>正文


PHP ObjectProphecy::exec_SELECTgetSingleRow方法代码示例

本文整理汇总了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);
 }
开发者ID:dachcom-digital,项目名称:TYPO3.CMS,代码行数:11,代码来源:DatabaseEditRowTest.php

示例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']);
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:12,代码来源:DatabaseParentPageRowTest.php

示例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));
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:14,代码来源:DatabaseRecordTypeValueTest.php

示例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([]));
 }
开发者ID:rickymathew,项目名称:TYPO3.CMS,代码行数:16,代码来源:DatabaseSystemLanguageRowsTest.php

示例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));
 }
开发者ID:graurus,项目名称:testgit_t37,代码行数:26,代码来源:DatabaseLanguageRowsTest.php


注:本文中的Prophecy\Prophecy\ObjectProphecy::exec_SELECTgetSingleRow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。