當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ObjectProphecy::set方法代碼示例

本文整理匯總了PHP中Prophecy\Prophecy\ObjectProphecy::set方法的典型用法代碼示例。如果您正苦於以下問題:PHP ObjectProphecy::set方法的具體用法?PHP ObjectProphecy::set怎麽用?PHP ObjectProphecy::set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Prophecy\Prophecy\ObjectProphecy的用法示例。


在下文中一共展示了ObjectProphecy::set方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: setWithoutNamedParameterQuotesIdentifierAndDelegatesToConcreteQueryBuilder

 /**
  * @test
  */
 public function setWithoutNamedParameterQuotesIdentifierAndDelegatesToConcreteQueryBuilder()
 {
     $this->connection->quoteIdentifier('aField')->shouldBeCalled()->willReturnArgument(0);
     $this->concreteQueryBuilder->createNamedParameter(Argument::cetera())->shouldNotBeCalled();
     $this->concreteQueryBuilder->set('aField', 'aValue')->shouldBeCalled()->willReturn($this->subject);
     $this->subject->set('aField', 'aValue', false);
 }
開發者ID:dachcom-digital,項目名稱:TYPO3.CMS,代碼行數:10,代碼來源:QueryBuilderTest.php

示例2: testSetWorkingCopySetting

 public function testSetWorkingCopySetting()
 {
     $this->configEditor->get('global-settings.sample_name', '')->willReturn('global_value');
     $setting_name = 'path-settings[svn://localhost].sample_name';
     $this->configEditor->get($setting_name)->willReturn('old_value');
     $this->configEditor->set($setting_name, 'new_value')->will(function (array $args, $object) {
         $object->get($args[0])->willReturn($args[1]);
     });
     $this->command->getConfigSettings()->willReturn(array(new StringConfigSetting('sample_name', '', AbstractConfigSetting::SCOPE_WORKING_COPY)));
     $this->workingCopyResolver->getWorkingCopyUrl('/path/to/working-copy')->willReturn('svn://localhost');
     $this->commandConfig->setSettingValue('sample_name', $this->command->reveal(), '/path/to/working-copy', 'new_value');
     $this->assertEquals('new_value', $this->commandConfig->getSettingValue('sample_name', $this->command->reveal(), '/path/to/working-copy'));
 }
開發者ID:console-helpers,項目名稱:svn-buddy,代碼行數:13,代碼來源:CommandConfigTest.php

示例3: testStorage

 /**
  * @dataProvider storageDataProvider
  */
 public function testStorage($user_value, $stored_value)
 {
     $this->configEditor->set(new ConfigStorageNameToken('name', AbstractConfigSetting::SCOPE_GLOBAL), $stored_value)->shouldBeCalled();
     $config_setting = $this->createConfigSetting(AbstractConfigSetting::SCOPE_GLOBAL);
     $config_setting->setValue($user_value);
 }
開發者ID:aik099,項目名稱:svn-buddy,代碼行數:9,代碼來源:AbstractConfigSettingTest.php

示例4: clientLock

 protected function clientLock(ObjectProphecy $client)
 {
     $client->set(Argument::type('string'), Argument::exact(1), Argument::type('array'))->willReturn(true);
     $client->expire(Argument::type('string'), Argument::exact(31))->willReturn(true);
     $client->del(Argument::type('string'))->willReturn(true);
 }
開發者ID:blablacar,項目名稱:redis-client,代碼行數:6,代碼來源:SessionHandlerTest.php

示例5: testSet

 /**
  * @covers ::set
  *
  * @dataProvider providerSet
  *
  * @param string $key
  * @param mixed $value
  */
 public function testSet($key, $value)
 {
     $this->decoratedFormState->set($key, $value)->shouldBeCalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->set($key, $value));
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:13,代碼來源:FormStateDecoratorBaseTest.php


注:本文中的Prophecy\Prophecy\ObjectProphecy::set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。